diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.format.ps1xml b/generated/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.format.ps1xml index 494392d33ad0..3133bcbacbd6 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.format.ps1xml +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.format.ps1xml @@ -4,7 +4,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKey - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKey + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKey#Multiple @@ -44,7 +44,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKeyTableView - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKeyTableView + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApiKeyTableView#Multiple @@ -84,7 +84,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponent - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponent + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponent#Multiple @@ -220,7 +220,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentTableView - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentTableView + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentTableView#Multiple @@ -356,7 +356,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan#Multiple @@ -522,7 +522,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSComponentLinkedStorageAccounts - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSComponentLinkedStorageAccounts + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSComponentLinkedStorageAccounts#Multiple @@ -550,7 +550,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCap - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCap + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCap#Multiple @@ -584,7 +584,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCapStatus - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCapStatus + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSDailyCapStatus#Multiple @@ -612,7 +612,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfiguration - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfiguration + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfiguration#Multiple @@ -688,7 +688,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfigurationTableView - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfigurationTableView + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSExportConfigurationTableView#Multiple @@ -764,7 +764,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSPricingPlan - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSPricingPlan + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSPricingPlan#Multiple @@ -796,81 +796,45 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsIdentity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Annotation - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsIdentity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Annotation#Multiple - - - - - - - - - - - - - - - - - - - + - + - + - + - + - AnnotationId - - - ComponentName - - - ExportId - - - KeyId - - - PurgeId - - - ResourceGroupName - - - ResourceName + Category - RevisionId + EventTime - StorageType + Name - SubscriptionId + Property - WebTestName + RelatedAnnotation @@ -878,27 +842,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationError - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationError#Multiple - + - + - PrincipalId + Code - TenantId + Message @@ -906,27 +870,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApiKeyRequest - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApiKeyRequest#Multiple - - - - + - ClientId - - - PrincipalId + Name @@ -934,27 +892,45 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderField + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponent - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderField + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponent#Multiple + + + - + + + + + + + + + Location + Name - Value + Etag + + + Kind + + + ResourceGroupName @@ -962,39 +938,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKey - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKey#Multiple - + - + - + - + - Name + ApiKey - Location + CreatedDate - WebTestKind + Name - Enabled + ResourceGroupName @@ -1002,43 +978,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentDataVolumeCap - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentDataVolumeCap#Multiple - + - - - - - - Location - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestListResult - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestListResult - - - - + + + + + + + + + + + + + - NextLink + Cap + + + MaxHistoryCap + + + ResetTime + + + StopSendNotificationWhenHitCap + + + StopSendNotificationWhenHitThreshold + + + WarningThreshold @@ -1046,137 +1030,129 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportConfiguration - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportConfiguration#Multiple - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Description + ApplicationName - Enabled + ContainerName - Frequency + DestinationAccountId - ProvisioningState + DestinationStorageLocationId - RetryEnabled + DestinationStorageSubscriptionId - SyntheticMonitorId + DestinationType - Timeout + ExportId - WebTestKind + ExportStatus - WebTestName + InstrumentationKey - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesConfiguration - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesConfiguration - - - - - - - - - - - WebTest + IsUserEnabled - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesRequest - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesRequest - - - - - - - - - - - - - - - - - - - - - - - FollowRedirect + LastGapTime - HttpVerb + LastSuccessTime - ParseDependentRequest + LastUserUpdate - RequestBody + NotificationQueueEnabled - RequestUrl + PermanentErrorReason + + + RecordType + + + ResourceGroup + + + StorageName + + + SubscriptionId @@ -1184,101 +1160,69 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRules + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportRequest - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRules + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportRequest#Multiple - + - + - + - + + + + + + + + + + + + + + + + - ExpectedHttpStatusCode + DestinationAccountId - IgnoreHttpsStatusCode + DestinationAddress - SslCertRemainingLifetimeCheck + DestinationStorageLocationId - SslCheck + DestinationStorageSubscriptionId - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidation - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidation - - - - - - - - - - - - - - - - - ContentMatch + DestinationType - IgnoreCase + IsEnabled - PassIfTextFound + NotificationQueueEnabled - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResource - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResource - - - - - - - - - - - - - - Location + NotificationQueueUri - Name + RecordType @@ -1286,101 +1230,63 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeature - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeature#Multiple - + - - - - - - Item - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.Workbook - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.Workbook - - - - + - + - + - + - + - + + + + - ResourceGroupName + FeatureName - Name + IsHidden - DisplayName + IsMainFeature - Location + MeterId - Kind + MeterRateFrequency - Category + ResouceId - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookProperties - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookProperties - - - - - - - - - - - - - - DisplayName + SupportedAddonFeature - Category + Title @@ -1388,61 +1294,111 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookPropertiesUpdateParameters + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeatureCapabilities - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookPropertiesUpdateParameters + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeatureCapabilities#Multiple - + - + - - - - - - DisplayName - - - Category - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookResource - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookResource - - - - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Name + AnalyticsIntegration - Location + ApiAccessLevel - Kind + ApplicationMap + + + BurstThrottlePolicy + + + DailyCap + + + DailyCapResetTime + + + LiveStreamMetric + + + MetadataClass + + + MultipleStepWebTest + + + OpenSchema + + + PowerBiIntegration + + + ProactiveDetection + + + SupportExportData + + + ThrottleRate + + + TrackingType + + + WorkItemIntegration @@ -1450,55 +1406,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParameters + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeatureCapability - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParameters + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeatureCapability#Multiple - + - + - + + + + + + + + + + - DisplayName + Description - Kind + MeterId - Category - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParametersTags - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParametersTags - - - - - - - - - - + MeterRateFrequency + - Item + Name + + + Unit + + + Value @@ -1506,27 +1458,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorDefinition + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentListResult - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorDefinition + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentListResult#Multiple - - - - + - Code - - - Message + NextLink @@ -1534,33 +1480,159 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorFieldContract + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentProperties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorFieldContract + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentProperties#Multiple - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Code + AppId - Message + ApplicationId - Target + ApplicationType + + + ConnectionString + + + CreationDate + + + DisableIPMasking + + + DisableLocalAuth + + + FlowType + + + ForceCustomerStorageForProfiler + + + HockeyAppId + + + HockeyAppToken + + + ImmediatePurgeDataOn30Day + + + IngestionMode + + + InstrumentationKey + + + LaMigrationDate + + + Name + + + ProvisioningState + + + PublicNetworkAccessForIngestion + + + PublicNetworkAccessForQuery + + + RequestSource + + + RetentionInDay + + + SamplingPercentage + + + TenantId + + + WorkspaceResourceId @@ -1568,49 +1640,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentQuotaStatus - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentQuotaStatus#Multiple - + - + + + + - Code + AppId - Message + ExpirationTime - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.InnerErrorTrace - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.InnerErrorTrace - - - - - - - - - - - Trace + ShouldBeThrottled @@ -1618,51 +1674,81 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbook + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsIdentity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbook + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsIdentity#Multiple + + + + + + + + + + + + + + + - + - + - + - + - + + + AnnotationId + + + ComponentName + + + ExportId + + + KeyId + + + PurgeId + ResourceGroupName - Name + ResourceName - DisplayName + RevisionId - Location + StorageType - Kind + SubscriptionId - Category + WebTestName @@ -1670,27 +1756,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccounts - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccounts#Multiple - + - + - DisplayName + Name - Category + ResourceGroupName @@ -1698,27 +1784,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeBody - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeBody#Multiple - - - - + - Name - - - Location + Table @@ -1726,21 +1806,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceEtag + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeBodyFilters - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceEtag + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeBodyFilters#Multiple - + + + + + + + - Item + Column + + + Key + + + Operator @@ -1748,21 +1840,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeResponse - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeResponse#Multiple - + - Item + OperationId @@ -1770,21 +1862,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.Operation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeStatusResponse - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.Operation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeStatusResponse#Multiple - + - Name + Status @@ -1792,33 +1884,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResource - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResource#Multiple - - - - + - + - Operation - - - Provider + Location - Resource + Name @@ -1826,21 +1912,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResourceTags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResourceTags#Multiple - + - NextLink + Item @@ -1848,33 +1934,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplate + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorDefinition - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplate + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorDefinition#Multiple - - - - + - + - ResourceGroupName - - - Name + Code - Location + Message @@ -1882,27 +1962,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGallery + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorFieldContract - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGallery + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorFieldContract#Multiple - + - + + + + - Name + Code - Category + Message + + + Target @@ -1910,27 +1996,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponse - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponse#Multiple - + - + - Name + Code - Location + Message @@ -1938,21 +2024,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponentsError - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponentsError#Multiple - + + + + - Item + Code + + + Message @@ -1960,21 +2052,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateUpdateParametersTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseLinkedStorageError - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateUpdateParametersTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseLinkedStorageError#Multiple - + + + + - Item + Code + + + Message @@ -1982,9 +2080,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccounts + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderField - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ComponentLinkedStorageAccounts + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderField#Multiple @@ -1992,7 +2090,7 @@ - + @@ -2002,7 +2100,7 @@ Name - ResourceGroupName + Value @@ -2010,27 +2108,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.InnerError - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.InnerError#Multiple - + - + - Code + Diagnosticcontext - Message + Time @@ -2038,9 +2136,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.LinkedStorageAccountsProperties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.LinkedStorageAccountsProperties#Multiple @@ -2060,67 +2158,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ManagedServiceIdentity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ManagedServiceIdentity#Multiple - - - - - - - - - - + - + - Location - - - Name - - - Etag - - - Kind - - - ResourceGroupName + PrincipalId - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentListResult - - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentListResult - - - - - - - - - - - NextLink + TenantId @@ -2128,159 +2186,151 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentProperties + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - + - + - + - + - - - - AppId - - - ApplicationId - - - ApplicationType - - - ConnectionString - - - CreationDate - - - DisableIPMasking - - - DisableLocalAuth - - - FlowType - - - ForceCustomerStorageForProfiler - - - HockeyAppId - - - HockeyAppToken - - - ImmediatePurgeDataOn30Day - + + - IngestionMode + ResourceGroupName - InstrumentationKey + Name - LaMigrationDate + DisplayName - Name + Location - ProvisioningState + Kind - PublicNetworkAccessForIngestion + Category + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookProperties + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookProperties#Multiple + + + + + + + + + + + + + - PublicNetworkAccessForQuery + DisplayName - RequestSource + Category + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResource + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResource#Multiple + + + + + + + + + + + + + - RetentionInDay + Name - SamplingPercentage + Location + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceEtag + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceEtag#Multiple + + + + + + + + + + - TenantId + Item + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceTags#Multiple + + + + + + + + + + - WorkspaceResourceId + Item @@ -2288,21 +2338,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBody + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Operation - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBody + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Operation#Multiple - + - Table + Name @@ -2310,33 +2360,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBodyFilters + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeBodyFilters + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationDisplay#Multiple - + - + - + - Column + Operation - Key + Provider - Operator + Resource @@ -2344,21 +2394,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeResponse + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationListResult - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeResponse + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationListResult#Multiple - + - OperationId + NextLink @@ -2366,21 +2416,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeStatusResponse + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PrivateLinkScopedResource - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentPurgeStatusResponse + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PrivateLinkScopedResource#Multiple - + + + + - Status + ResourceId + + + ScopeId @@ -2388,15 +2444,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ProxyResource - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ProxyResource#Multiple - - - @@ -2404,9 +2457,6 @@ - - Location - Name @@ -2416,21 +2466,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Resource#Multiple - + - Item + Name @@ -2438,27 +2488,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemData - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemData#Multiple - + - + + + + + + + + + + + + + - Code + CreatedAt - Message + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType @@ -2466,27 +2540,49 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TagsResourceTags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TagsResourceTags#Multiple - + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResource + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResource#Multiple + + + - + + + + - ResourceId + Name - ScopeId + Location @@ -2494,9 +2590,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTags#Multiple @@ -2516,45 +2612,67 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.Annotation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.Annotation + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentity#Multiple - + - + + + + + + + ClientId + + + PrincipalId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTest + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTest#Multiple + + + - + - + + + + - Category - - - EventTime + Name - Name + Location - Property + WebTestKind - RelatedAnnotation + Enabled @@ -2562,27 +2680,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationError + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocation - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.AnnotationError + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocation#Multiple - - - - + - Code - - - Message + Location @@ -2590,33 +2702,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApiKeyRequest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestListResult - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApiKeyRequest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestListResult#Multiple - - - - - - - + - LinkedReadProperty - - - LinkedWriteProperty - - - Name + NextLink @@ -2624,51 +2724,69 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKey + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestProperties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentApiKey + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestProperties#Multiple - + - + - + - + - + - + + + + + + + + + + - ApiKey + Description - CreatedDate + Enabled + + + Frequency - LinkedReadProperty + ProvisioningState - LinkedWriteProperty + RetryEnabled - Name + SyntheticMonitorId - ResourceGroupName + Timeout + + + WebTestKind + + + WebTestName @@ -2676,21 +2794,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentBillingFeatures + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesConfiguration - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentBillingFeatures + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesConfiguration#Multiple - + - CurrentBillingFeature + WebTest @@ -2698,51 +2816,45 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCap + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesRequest - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCap + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesRequest#Multiple - - - - + - + - + - + - + - Cap - - - MaxHistoryCap + FollowRedirect - ResetTime + HttpVerb - StopSendNotificationWhenHitCap + ParseDependentRequest - StopSendNotificationWhenHitThreshold + RequestBody - WarningThreshold + RequestUrl @@ -2750,129 +2862,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportConfiguration + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRules - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportConfiguration + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRules#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - ApplicationName - - - ContainerName - - - DestinationAccountId - - - DestinationStorageLocationId - - - DestinationStorageSubscriptionId - - - DestinationType - - - ExportId - - - ExportStatus - - - InstrumentationKey - - - IsUserEnabled - - - LastGapTime - - - LastSuccessTime - - - LastUserUpdate - - - NotificationQueueEnabled - - - PermanentErrorReason - - - RecordType + ExpectedHttpStatusCode - ResourceGroup + IgnoreHttpsStatusCode - StorageName + SslCertRemainingLifetimeCheck - SubscriptionId + SslCheck @@ -2880,69 +2902,83 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportRequest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidation - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentExportRequest + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidation#Multiple - - - - - - - - - - - - - - - - - - - + - + - + - DestinationAccountId - - - DestinationAddress - - - DestinationStorageLocationId - - - DestinationStorageSubscriptionId + ContentMatch - DestinationType + IgnoreCase - IsEnabled + PassIfTextFound + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResource + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResource#Multiple + + + + + + + + + + + + + - NotificationQueueEnabled + Location - NotificationQueueUri + Name + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResourceTags#Multiple + + + + + + + + + + - RecordType + Item @@ -2950,63 +2986,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeature + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeature + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook#Multiple - - - - - - - + - + - + - + - + - + - FeatureName - - - IsHidden - - - IsMainFeature + ResourceGroupName - MeterId + Name - MeterRateFrequency + DisplayName - ResouceId + Location - SupportedAddonFeature + Kind - Title + Category @@ -3014,111 +3038,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapabilities + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookProperties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapabilities + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookProperties#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - AnalyticsIntegration - - - ApiAccessLevel - - - ApplicationMap - - - BurstThrottlePolicy - - - DailyCap - - - DailyCapResetTime - - - LiveStreamMetric - - - MetadataClass - - - MultipleStepWebTest - - - OpenSchema - - - PowerBiIntegration - - - ProactiveDetection - - - SupportExportData - - - ThrottleRate - - - TrackingType + DisplayName - WorkItemIntegration + Category @@ -3126,51 +3066,61 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapability + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookPropertiesUpdateParameters - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapability + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookPropertiesUpdateParameters#Multiple - - - - + - + + + + + + + DisplayName + + + Category + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResource + + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResource#Multiple + + + - + - + - - Description - - - MeterId - - - MeterRateFrequency - Name - Unit + Location - Value + Kind @@ -3178,33 +3128,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentQuotaStatus + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentQuotaStatus + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate#Multiple - + - + - + - AppId + ResourceGroupName - ExpirationTime + Name - ShouldBeThrottled + Location @@ -3212,27 +3162,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerError + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGallery - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerError + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGallery#Multiple - + - + - Diagnosticcontext + Name - Time + Category @@ -3240,15 +3190,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResource - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResource#Multiple + + + @@ -3256,27 +3209,30 @@ Name + + Location + - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResourceTags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResourceTags#Multiple - + - Name + Item @@ -3284,51 +3240,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemData + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateUpdateParametersTags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemData + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateUpdateParametersTags#Multiple - - - - - - - - - - - - - - - - + - CreatedAt - - - CreatedBy - - - CreatedByType - - - LastModifiedAt - - - LastModifiedBy - - - LastModifiedByType + Item @@ -3336,27 +3262,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParameters - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParameters#Multiple - + - + + + + - Name + DisplayName - Location + Kind + + + Category @@ -3364,9 +3296,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParametersTags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParametersTags#Multiple diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.psd1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.psd1 index a12f44d4080c..a67987c5c012 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.psd1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/Az.ApplicationInsights.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.ApplicationInsights.private.dll' FormatsToProcess = './Az.ApplicationInsights.format.ps1xml' - FunctionsToExport = 'Get-AzApplicationInsights', 'Get-AzApplicationInsightsApiKey', 'Get-AzApplicationInsightsContinuousExport', 'Get-AzApplicationInsightsLinkedStorageAccount', 'Get-AzApplicationInsightsMyWorkbook', 'Get-AzApplicationInsightsWebTest', 'Get-AzApplicationInsightsWorkbook', 'Get-AzApplicationInsightsWorkbookRevision', 'Get-AzApplicationInsightsWorkbookTemplate', 'New-AzApplicationInsights', 'New-AzApplicationInsightsApiKey', 'New-AzApplicationInsightsContinuousExport', 'New-AzApplicationInsightsLinkedStorageAccount', 'New-AzApplicationInsightsMyWorkbook', 'New-AzApplicationInsightsWebTest', 'New-AzApplicationInsightsWebTestGeolocationObject', 'New-AzApplicationInsightsWebTestHeaderFieldObject', 'New-AzApplicationInsightsWorkbook', 'New-AzApplicationInsightsWorkbookTemplate', 'New-AzApplicationInsightsWorkbookTemplateGalleryObject', 'Remove-AzApplicationInsights', 'Remove-AzApplicationInsightsApiKey', 'Remove-AzApplicationInsightsContinuousExport', 'Remove-AzApplicationInsightsLinkedStorageAccount', 'Remove-AzApplicationInsightsMyWorkbook', 'Remove-AzApplicationInsightsWebTest', 'Remove-AzApplicationInsightsWorkbook', 'Remove-AzApplicationInsightsWorkbookTemplate', 'Set-AzApplicationInsightsContinuousExport', 'Set-AzApplicationInsightsDailyCap', 'Set-AzApplicationInsightsPricingPlan', 'Update-AzApplicationInsights', 'Update-AzApplicationInsightsLinkedStorageAccount', 'Update-AzApplicationInsightsMyWorkbook', 'Update-AzApplicationInsightsWebTestTag', 'Update-AzApplicationInsightsWorkbook', 'Update-AzApplicationInsightsWorkbookTemplate', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzApplicationInsights', 'Get-AzApplicationInsightsApiKey', 'Get-AzApplicationInsightsContinuousExport', 'Get-AzApplicationInsightsLinkedStorageAccount', 'Get-AzApplicationInsightsMyWorkbook', 'Get-AzApplicationInsightsWebTest', 'Get-AzApplicationInsightsWorkbook', 'Get-AzApplicationInsightsWorkbookRevision', 'Get-AzApplicationInsightsWorkbookTemplate', 'New-AzApplicationInsights', 'New-AzApplicationInsightsApiKey', 'New-AzApplicationInsightsContinuousExport', 'New-AzApplicationInsightsLinkedStorageAccount', 'New-AzApplicationInsightsMyWorkbook', 'New-AzApplicationInsightsWebTest', 'New-AzApplicationInsightsWebTestGeolocationObject', 'New-AzApplicationInsightsWebTestHeaderFieldObject', 'New-AzApplicationInsightsWorkbook', 'New-AzApplicationInsightsWorkbookTemplate', 'New-AzApplicationInsightsWorkbookTemplateGalleryObject', 'Remove-AzApplicationInsights', 'Remove-AzApplicationInsightsApiKey', 'Remove-AzApplicationInsightsContinuousExport', 'Remove-AzApplicationInsightsLinkedStorageAccount', 'Remove-AzApplicationInsightsMyWorkbook', 'Remove-AzApplicationInsightsWebTest', 'Remove-AzApplicationInsightsWorkbook', 'Remove-AzApplicationInsightsWorkbookTemplate', 'Set-AzApplicationInsightsContinuousExport', 'Set-AzApplicationInsightsDailyCap', 'Set-AzApplicationInsightsPricingPlan', 'Update-AzApplicationInsights', 'Update-AzApplicationInsightsLinkedStorageAccount', 'Update-AzApplicationInsightsMyWorkbook', 'Update-AzApplicationInsightsWebTestTag', 'Update-AzApplicationInsightsWorkbook', 'Update-AzApplicationInsightsWorkbookTemplate' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ApplicationInsights' diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/Properties/AssemblyInfo.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/Properties/AssemblyInfo.cs index fb6d076faace..3c2273dcd721 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/Properties/AssemblyInfo.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ApplicationInsightsManagementClient")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3.0")] -[assembly: System.Reflection.AssemblyVersionAttribute("2.3.0")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("2.3.1")] +[assembly: System.Reflection.AssemblyVersionAttribute("2.3.1")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/check-dependencies.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/check-dependencies.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/check-dependencies.ps1 @@ -12,13 +12,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) $ErrorActionPreference = 'Stop' -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsights.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsights.ps1 index 265bc319ae73..6b1f9340640b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsights.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsights.ps1 @@ -27,7 +27,7 @@ Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePr .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Outputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan .Notes @@ -35,7 +35,7 @@ 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 +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [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. @@ -45,14 +45,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsights #> function Get-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent], [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent], [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan])] [CmdletBinding(DefaultParameterSetName='ListBySubscription', PositionalBinding=$false)] param( [Parameter(ParameterSetName='ListBySubscription')] @@ -154,6 +154,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -179,9 +188,7 @@ begin { GetByResourceId = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; GetByInputObject = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; } - if (('ListBySubscription', 'ListByResourceGroupName', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('ListBySubscription', 'ListByResourceGroupName', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -195,6 +202,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsApiKey.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsApiKey.ps1 index 252cd31dffc2..59cd30af7f85 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsApiKey.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsApiKey.ps1 @@ -27,12 +27,26 @@ Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Api .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -43,17 +57,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsapikey #> function Get-AzApplicationInsightsApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityComponent', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The API Key ID. @@ -88,9 +103,14 @@ param( [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='GetViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -147,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -168,11 +197,10 @@ begin { $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_GetViaIdentity'; + GetViaIdentityComponent = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_GetViaIdentityComponent'; List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -186,6 +214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsContinuousExport.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsContinuousExport.ps1 index 101d7a88ca1e..da6e27fd0f07 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsContinuousExport.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsContinuousExport.ps1 @@ -27,12 +27,26 @@ Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -43,17 +57,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscontinuousexport #> function Get-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityComponent', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The Continuous Export configuration ID. @@ -88,9 +103,14 @@ param( [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='GetViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -147,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -168,11 +197,10 @@ begin { $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_GetViaIdentity'; + GetViaIdentityComponent = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_GetViaIdentityComponent'; List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -186,6 +214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsLinkedStorageAccount.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsLinkedStorageAccount.ps1 index 3e4ac90b6021..0532663b5d1d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsLinkedStorageAccount.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsLinkedStorageAccount.ps1 @@ -25,7 +25,7 @@ Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -Compo .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts .Notes COMPLEX PARAMETER PROPERTIES @@ -41,14 +41,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightslinkedstorageaccount #> function Get-AzApplicationInsightsLinkedStorageAccount { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -76,7 +76,6 @@ param( [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()] @@ -135,6 +134,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -157,9 +165,7 @@ begin { Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsLinkedStorageAccount_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsLinkedStorageAccount_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -173,6 +179,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsMyWorkbook.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsMyWorkbook.ps1 index 1776ff1f94b2..cb812daa070e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsMyWorkbook.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsMyWorkbook.ps1 @@ -27,12 +27,12 @@ Get-AzApplicationInsightsMyWorkbook -ResourceGroupName appinsights-hkrs2v-test - Get-AzApplicationInsightsMyWorkbook -ResourceGroupName appinsights-hkrs2v-test -Category 'workbook' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsmyworkbook #> function Get-AzApplicationInsightsMyWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -58,9 +58,9 @@ param( [Parameter(ParameterSetName='List', Mandatory)] [Parameter(ParameterSetName='List1', Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("workbook", "TSG", "performance", "retention")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType] + [System.String] # Category of workbook to return. ${Category}, @@ -82,7 +82,8 @@ param( [Parameter(ParameterSetName='List1')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] - [System.String[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] # Tags presents on each workbook returned. ${Tag}, @@ -142,6 +143,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -165,9 +175,7 @@ begin { List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsMyWorkbook_List'; List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsMyWorkbook_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -181,6 +189,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWebTest.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWebTest.ps1 index e19ddcbb9cbb..3fd87c1b39ef 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWebTest.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWebTest.ps1 @@ -40,7 +40,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standar .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest .Notes COMPLEX PARAMETER PROPERTIES @@ -56,14 +56,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightswebtest #> function Get-AzApplicationInsightsWebTest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -96,7 +96,6 @@ param( [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='List2', Mandatory)] @@ -161,6 +160,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -186,9 +194,7 @@ begin { 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')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1', 'List2') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -202,6 +208,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbook.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbook.ps1 index 989015b9017a..7b40d3072340 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbook.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbook.ps1 @@ -32,7 +32,7 @@ Get-AzApplicationInsightsWorkbook -ResourceGroupName appinsights-hkrs2v-test -Ca .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook .Notes COMPLEX PARAMETER PROPERTIES @@ -48,14 +48,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsworkbook #> function Get-AzApplicationInsightsWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -85,7 +85,6 @@ param( [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()] @@ -97,9 +96,9 @@ param( [Parameter(ParameterSetName='List', Mandatory)] [Parameter(ParameterSetName='List1', Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("workbook", "TSG", "performance", "retention")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType] + [System.String] # Category of workbook to return. ${Category}, @@ -107,7 +106,8 @@ param( [Parameter(ParameterSetName='List1')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] - [System.String[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] # Tags presents on each workbook returned. ${Tag}, @@ -173,6 +173,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -197,9 +206,7 @@ begin { List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbook_List'; List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbook_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -213,6 +220,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbookRevision.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbookRevision.ps1 index fbf81a5a80ee..ad3d17fe7538 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbookRevision.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbookRevision.ps1 @@ -20,7 +20,7 @@ Get a single workbook revision defined by its revisionId. .Description Get a single workbook revision defined by its revisionId. .Example -Get-AzApplicationInsightsWorkbookRevision -ResourceGroupName appinsights-hkrs2v-test -Name f7d7151e-7907-4f46-8a5e-6bf4a4cfedec | fl +Get-AzApplicationInsightsWorkbookRevision -ResourceGroupName appinsights-hkrs2v-test -Name f7d7151e-7907-4f46-8a5e-6bf4a4cfedec | Format-List .Example Get-AzApplicationInsightsWorkbookRevision -ResourceGroupName appinsights-hkrs2v-test -Name f7d7151e-7907-4f46-8a5e-6bf4a4cfedec -RevisionId "91788fbfb8384ea5998ac73b9fa3e6eb" .Example @@ -29,7 +29,7 @@ Get-AzApplicationInsightsWorkbookRevision -InputObject "/subscriptions/xxxxxxxx- .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook .Notes COMPLEX PARAMETER PROPERTIES @@ -45,14 +45,28 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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. + +WORKBOOKINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsworkbookrevision #> function Get-AzApplicationInsightsWorkbookRevision { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -71,6 +85,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkbook', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The id of the workbook's revision. @@ -88,9 +103,14 @@ param( [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='GetViaIdentityWorkbook', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${WorkbookInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -147,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -168,11 +197,10 @@ begin { $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookRevision_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookRevision_GetViaIdentity'; + GetViaIdentityWorkbook = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookRevision_GetViaIdentityWorkbook'; List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookRevision_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -186,6 +214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbookTemplate.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbookTemplate.ps1 index e3b8cc45cdc4..47c6f3859f07 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbookTemplate.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Get-AzApplicationInsightsWorkbookTemplate.ps1 @@ -56,7 +56,7 @@ New-AzApplicationInsightsWorkbookTemplate -ResourceGroupName resourceGroup -Name .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate .Notes COMPLEX PARAMETER PROPERTIES @@ -72,14 +72,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsworkbooktemplate #> function Get-AzApplicationInsightsWorkbookTemplate { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -106,7 +106,6 @@ param( [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()] @@ -165,6 +164,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -187,9 +195,7 @@ begin { Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookTemplate_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookTemplate_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -203,6 +209,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsights.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsights.ps1 index d06772def34a..846812695d92 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsights.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsights.ps1 @@ -25,12 +25,12 @@ Note: You cannot specify a different value for InstrumentationKey nor AppId in t New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights #> function New-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -62,6 +62,7 @@ param( [Parameter()] [Alias('ApplicationKind')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other", "nodejs", "java", "ios", "store", "phone", "IgnoreCase")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The kind of application that this component refers to, used to customize UI. @@ -69,9 +70,9 @@ param( ${Kind}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + [System.String] # Type of application being monitored. ${ApplicationType}, @@ -94,9 +95,9 @@ param( ${Etag}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + [System.String] # 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}, @@ -111,6 +112,7 @@ param( [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. + # Please visit external url https://aka.ms/ewjuel to get more information. ${HockeyAppId}, [Parameter()] @@ -120,30 +122,30 @@ param( ${ImmediatePurgeDataOn30Day}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + [System.String] # Indicates the flow of the ingestion. ${IngestionMode}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights ingestion. ${PublicNetworkAccessForIngestion}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights query. ${PublicNetworkAccessForQuery}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + [System.String] # Describes what tool created this Application Insights component. # Customers using this API should set this to the default 'rest'. ${RequestSource}, @@ -158,12 +160,13 @@ param( [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. + # Please visit external url https://aka.ms/sl0yqd to get more information. ${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]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -181,7 +184,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -231,6 +235,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -252,9 +265,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsights'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -268,6 +279,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsApiKey.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsApiKey.ps1 index 7d7d68fe724d..a0da00189b05 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsApiKey.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsApiKey.ps1 @@ -26,12 +26,12 @@ New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Des .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey #> function New-AzApplicationInsightsApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey])] [CmdletBinding(DefaultParameterSetName='ComponentNameParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -63,6 +63,7 @@ param( [Parameter(Mandatory)] [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ReadTelemetry", "WriteAnnotations", "AuthenticateSDKControlChannel")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # The read access rights of this API Key. @@ -73,7 +74,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -123,6 +125,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -144,9 +155,7 @@ begin { $mapping = @{ ComponentNameParameterSet = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsApiKey'; } - if (('ComponentNameParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('ComponentNameParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -160,6 +169,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsContinuousExport.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsContinuousExport.ps1 index 8c320eb393d7..d035d2d01962 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsContinuousExport.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsContinuousExport.ps1 @@ -20,6 +20,7 @@ Create a Continuous Export configuration of an Application Insights component. .Description Create a Continuous Export configuration of an Application Insights component. .Example +$context = "*****" $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" ` @@ -27,12 +28,12 @@ New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " -StorageSASUri $sasuri -DestinationType Blob .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport #> function New-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -106,7 +107,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -156,6 +158,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,9 +188,7 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsContinuousExport'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -193,6 +202,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsLinkedStorageAccount.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsLinkedStorageAccount.ps1 index a7959c3829d3..0c5a8b13b20d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsLinkedStorageAccount.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsLinkedStorageAccount.ps1 @@ -21,15 +21,15 @@ Replace current linked storage account for an Application Insights component. Replace current linked storage account for an Application Insights component. .Example $account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" -Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | New-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id +New-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -Name "componentName" -LinkedStorageAccountResourceId $account.Id .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightslinkedstorageaccount #> function New-AzApplicationInsightsLinkedStorageAccount { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -53,12 +53,24 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Linked storage account resource ID ${LinkedStorageAccountResourceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -115,6 +127,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -135,10 +156,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsLinkedStorageAccount_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsLinkedStorageAccount_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsLinkedStorageAccount_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -152,6 +173,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsMyWorkbook.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsMyWorkbook.ps1 index dc9b49fbf5b7..eb1e2001d79f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsMyWorkbook.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsMyWorkbook.ps1 @@ -25,12 +25,12 @@ $name = (New-Guid).ToString() New-AzApplicationInsightsMyWorkbook -ResourceGroupName appinsights-hkrs2v-test -Name $name -Location westus2 -DisplayName "$name-display" -SourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/appinsights-hkrs2v-test/providers/microsoft.insights/components/appinsights-48mah3-pwsh" -Category 'workbook' -SerializedData $null .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsmyworkbook #> function New-AzApplicationInsightsMyWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -59,89 +59,101 @@ param( # Azure Resource Id that will fetch all linked workbooks. ${LinkedSourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Workbook category, as defined by the user at creation time. ${Category}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The user-defined name of the private workbook. ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag]))] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag]))] [System.Collections.Hashtable] # Resource etag ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Azure resource Id ${Id}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # The identity type. - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Resource location ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Configuration of this particular private workbook. # Configuration data is a string containing valid JSON ${SerializedData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Optional resourceId for a source resource. ${SourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # A list of 0 or more tags that are associated with this private workbook definition ${SourceTag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # BYOS Storage Account URI ${StorageUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Azure resource type ${Type}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # This instance's version of the data model. # This can change as new features are added that can be marked private workbook. ${Version}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -198,6 +210,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -218,17 +239,17 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsMyWorkbook_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsMyWorkbook_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsMyWorkbook_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind') ) { $PSBoundParameters['Kind'] = "user" } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -238,6 +259,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTest.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTest.ps1 index d52a593a1bd5..caad8a259216 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTest.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTest.ps1 @@ -72,7 +72,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwe " .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest .Notes COMPLEX PARAMETER PROPERTIES @@ -88,7 +88,7 @@ REQUESTHEADER : List of headers and their values to add to the W https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest #> function New-AzApplicationInsightsWebTest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest])] [CmdletBinding(DefaultParameterSetName='CreateStandard', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -160,15 +160,14 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.PSArgumentCompleterAttribute("ping", "multistep", "standard")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] + [System.String] # The kind of web test this is, valid choices are ping, multistep, and standard. ${Kind}, @@ -187,9 +186,8 @@ param( [Parameter(ParameterSetName='CreateStandard')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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')] @@ -222,20 +220,20 @@ param( # Validate that the WebTest returns the http status code provided. ${RuleExpectedHttpStatusCode}, - [Parameter(ParameterSetName='CreateStandard')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # When set, validation will ignore the status code. ${RuleIgnoreHttpsStatusCode}, - [Parameter(ParameterSetName='CreateStandard')] + [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(ParameterSetName='CreateStandard')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Checks to see if the SSL cert is still valid. @@ -243,7 +241,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -272,7 +270,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -322,6 +321,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -344,9 +352,7 @@ begin { CreateStandard = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; CreateClassic = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; } - if (('CreateStandard', 'CreateClassic') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateStandard', 'CreateClassic') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -360,6 +366,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestGeolocationObject.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestGeolocationObject.ps1 index 7c608ded2528..5682ffdc91ec 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestGeolocationObject.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestGeolocationObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for WebTestGeolocation. New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocation .Link -https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-AzApplicationInsightsWebTestGeolocationObject +https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-azapplicationinsightswebtestgeolocationobject #> function New-AzApplicationInsightsWebTestGeolocationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocation])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -45,6 +45,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -73,6 +76,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestHeaderFieldObject.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestHeaderFieldObject.ps1 index d60c4c88b3c8..a76616a503b9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestHeaderFieldObject.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWebTestHeaderFieldObject.ps1 @@ -16,19 +16,19 @@ <# .Synopsis -Create a in-memory object for HeaderField +Create an in-memory object for HeaderField. .Description -Create a in-memory object for HeaderField +Create an in-memory object for HeaderField. .Example New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderField +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderField .Link -https://learn.microsoft.com/powershell/module/az.ApplicationInsights/new-AzApplicationInsightsWebTestHeaderFieldObject +https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-azapplicationinsightswebtestheaderfieldobject #> function New-AzApplicationInsightsWebTestHeaderFieldObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderField])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderField])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -51,6 +51,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -79,6 +82,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbook.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbook.ps1 index ea0a16feb36b..53ef94732095 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbook.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbook.ps1 @@ -24,12 +24,12 @@ $name = (New-Guid).ToString() New-AzApplicationInsightsWorkbook -ResourceGroupName appinsights-hkrs2v-test -Name $name -Location westus2 -DisplayName "$name-display" -SourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/appinsights-hkrs2v-test/providers/microsoft.insights/components/appinsights-48mah3-pwsh" -Category 'workbook' -SerializedData $null .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsworkbook #> function New-AzApplicationInsightsWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -58,91 +58,101 @@ param( # Azure Resource Id that will fetch all linked workbooks. ${LinkedSourceId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Workbook category, as defined by the user at creation time. ${Category}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The description of the workbook. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The user-defined name (display name) of the workbook. ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Resource etag ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Configuration of this particular workbook. # Configuration data is a string containing valid JSON ${SerializedData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # ResourceId for a source resource. ${SourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # Being deprecated, please use the other tags field ${SourceTag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The resourceId to the storage account when bring your own storage is used ${StorageUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData ${Version}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -199,6 +209,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -219,17 +238,17 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbook_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbook_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbook_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind') ) { $PSBoundParameters['Kind'] = "shared" } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -239,6 +258,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbookTemplate.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbookTemplate.ps1 index 70f21519d9ae..0cc4ac9eb9ba 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbookTemplate.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbookTemplate.ps1 @@ -51,7 +51,7 @@ $data = @{ New-AzApplicationInsightsWorkbookTemplate -ResourceGroupName resourceGroup -Name 'workbooktemplate-pwsh01' -Location 'westus2' -Gallery $gallery -TemplateData $data -Priority 1 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate .Notes COMPLEX PARAMETER PROPERTIES @@ -67,7 +67,7 @@ GALLERY : Workbook galleries supported by the templa https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsworkbooktemplate #> function New-AzApplicationInsightsWorkbookTemplate { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -90,55 +90,66 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Resource location ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Information about the author of the workbook template. ${Author}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery[]] # Workbook galleries supported by the template. - # To construct, see NOTES section for GALLERY properties and create a hash table. ${Gallery}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized]))] [System.Collections.Hashtable] # Key value pair of localized gallery. # Each key is the locale code of languages supported by the Azure portal. ${Localized}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Priority of the template. # Determines which template to open when a workbook gallery is opened in viewer mode. ${Priority}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData]))] [System.Collections.Hashtable] # Valid JSON object containing workbook template payload. ${TemplateData}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -195,6 +206,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -215,10 +235,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbookTemplate_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbookTemplate_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbookTemplate_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -232,6 +252,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbookTemplateGalleryObject.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbookTemplateGalleryObject.ps1 index 2f177799ae7d..27363e07e736 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbookTemplateGalleryObject.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/New-AzApplicationInsightsWorkbookTemplateGalleryObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for WorkbookTemplateGallery. New-AzApplicationInsightsWorkbookTemplateGalleryObject -Category "Failures" -Name "Simple Template" -Type 'tsg' -ResourceType "microsoft.insights/components" -Order 100 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGallery +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGallery .Link -https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-AzApplicationInsightsWorkbookTemplateGalleryObject +https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-azapplicationinsightsworkbooktemplategalleryobject #> function New-AzApplicationInsightsWorkbookTemplateGalleryObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGallery])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGallery])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -69,6 +69,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -97,6 +100,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/ProxyCmdletDefinitions.ps1 index 86fac01feb8b..07b59f67806a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -27,12 +27,26 @@ Get-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Api .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -43,17 +57,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsapikey #> function Get-AzApplicationInsightsApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityComponent', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The API Key ID. @@ -88,9 +103,14 @@ param( [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='GetViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -147,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -168,11 +197,10 @@ begin { $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_GetViaIdentity'; + GetViaIdentityComponent = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_GetViaIdentityComponent'; List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsApiKey_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -186,6 +214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -242,12 +273,26 @@ Get-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -258,17 +303,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscontinuousexport #> function Get-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityComponent', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The Continuous Export configuration ID. @@ -303,9 +349,14 @@ param( [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='GetViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -362,6 +413,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -383,11 +443,10 @@ begin { $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_GetViaIdentity'; + GetViaIdentityComponent = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_GetViaIdentityComponent'; List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsContinuousExport_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -401,6 +460,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -455,7 +517,7 @@ Get-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -Compo .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts .Notes COMPLEX PARAMETER PROPERTIES @@ -471,14 +533,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightslinkedstorageaccount #> function Get-AzApplicationInsightsLinkedStorageAccount { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -506,7 +568,6 @@ param( [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()] @@ -565,6 +626,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -587,9 +657,7 @@ begin { Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsLinkedStorageAccount_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsLinkedStorageAccount_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -603,6 +671,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -659,12 +730,12 @@ Get-AzApplicationInsightsMyWorkbook -ResourceGroupName appinsights-hkrs2v-test - Get-AzApplicationInsightsMyWorkbook -ResourceGroupName appinsights-hkrs2v-test -Category 'workbook' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsmyworkbook #> function Get-AzApplicationInsightsMyWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -690,9 +761,9 @@ param( [Parameter(ParameterSetName='List', Mandatory)] [Parameter(ParameterSetName='List1', Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("workbook", "TSG", "performance", "retention")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType] + [System.String] # Category of workbook to return. ${Category}, @@ -714,7 +785,8 @@ param( [Parameter(ParameterSetName='List1')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] - [System.String[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] # Tags presents on each workbook returned. ${Tag}, @@ -774,6 +846,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -797,9 +878,7 @@ begin { List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsMyWorkbook_List'; List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsMyWorkbook_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -813,6 +892,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -882,7 +964,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standar .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest .Notes COMPLEX PARAMETER PROPERTIES @@ -898,14 +980,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightswebtest #> function Get-AzApplicationInsightsWebTest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -938,7 +1020,6 @@ param( [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='List2', Mandatory)] @@ -1003,6 +1084,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1028,9 +1118,7 @@ begin { 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')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1', 'List2') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1044,6 +1132,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1093,7 +1184,7 @@ Get a single workbook revision defined by its revisionId. .Description Get a single workbook revision defined by its revisionId. .Example -Get-AzApplicationInsightsWorkbookRevision -ResourceGroupName appinsights-hkrs2v-test -Name f7d7151e-7907-4f46-8a5e-6bf4a4cfedec | fl +Get-AzApplicationInsightsWorkbookRevision -ResourceGroupName appinsights-hkrs2v-test -Name f7d7151e-7907-4f46-8a5e-6bf4a4cfedec | Format-List .Example Get-AzApplicationInsightsWorkbookRevision -ResourceGroupName appinsights-hkrs2v-test -Name f7d7151e-7907-4f46-8a5e-6bf4a4cfedec -RevisionId "91788fbfb8384ea5998ac73b9fa3e6eb" .Example @@ -1102,7 +1193,7 @@ Get-AzApplicationInsightsWorkbookRevision -InputObject "/subscriptions/xxxxxxxx- .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook .Notes COMPLEX PARAMETER PROPERTIES @@ -1118,14 +1209,28 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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. + +WORKBOOKINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsworkbookrevision #> function Get-AzApplicationInsightsWorkbookRevision { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1144,6 +1249,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityWorkbook', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The id of the workbook's revision. @@ -1161,9 +1267,14 @@ param( [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='GetViaIdentityWorkbook', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${WorkbookInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1220,6 +1331,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1241,11 +1361,10 @@ begin { $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookRevision_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookRevision_GetViaIdentity'; + GetViaIdentityWorkbook = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookRevision_GetViaIdentityWorkbook'; List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookRevision_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1259,6 +1378,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1344,7 +1466,7 @@ New-AzApplicationInsightsWorkbookTemplate -ResourceGroupName resourceGroup -Name .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate .Notes COMPLEX PARAMETER PROPERTIES @@ -1360,14 +1482,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsworkbooktemplate #> function Get-AzApplicationInsightsWorkbookTemplate { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1394,7 +1516,6 @@ param( [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()] @@ -1453,6 +1574,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1475,9 +1605,7 @@ begin { Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookTemplate_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbookTemplate_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1491,6 +1619,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1552,7 +1683,7 @@ Get-AzApplicationInsightsWorkbook -ResourceGroupName appinsights-hkrs2v-test -Ca .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook .Notes COMPLEX PARAMETER PROPERTIES @@ -1568,14 +1699,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsworkbook #> function Get-AzApplicationInsightsWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1605,7 +1736,6 @@ param( [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()] @@ -1617,9 +1747,9 @@ param( [Parameter(ParameterSetName='List', Mandatory)] [Parameter(ParameterSetName='List1', Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("workbook", "TSG", "performance", "retention")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType] + [System.String] # Category of workbook to return. ${Category}, @@ -1627,7 +1757,8 @@ param( [Parameter(ParameterSetName='List1')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] - [System.String[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] # Tags presents on each workbook returned. ${Tag}, @@ -1693,6 +1824,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1717,9 +1857,7 @@ begin { List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbook_List'; List1 = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsWorkbook_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1733,6 +1871,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1783,15 +1924,15 @@ Replace current linked storage account for an Application Insights component. Replace current linked storage account for an Application Insights component. .Example $account = Get-AzStorageAccount -ResourceGroupName "rgName" -Name "accountName" -Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | New-AzApplicationInsightsLinkedStorageAccount -LinkedStorageAccountResourceId $account.Id +New-AzApplicationInsightsLinkedStorageAccount -ResourceGroupName "rgName" -Name "componentName" -LinkedStorageAccountResourceId $account.Id .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightslinkedstorageaccount #> function New-AzApplicationInsightsLinkedStorageAccount { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -1815,12 +1956,24 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Linked storage account resource ID ${LinkedStorageAccountResourceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1877,6 +2030,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1897,10 +2059,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsLinkedStorageAccount_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsLinkedStorageAccount_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsLinkedStorageAccount_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1914,6 +2076,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1968,12 +2133,12 @@ $name = (New-Guid).ToString() New-AzApplicationInsightsMyWorkbook -ResourceGroupName appinsights-hkrs2v-test -Name $name -Location westus2 -DisplayName "$name-display" -SourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/appinsights-hkrs2v-test/providers/microsoft.insights/components/appinsights-48mah3-pwsh" -Category 'workbook' -SerializedData $null .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsmyworkbook #> function New-AzApplicationInsightsMyWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -2002,89 +2167,101 @@ param( # Azure Resource Id that will fetch all linked workbooks. ${LinkedSourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Workbook category, as defined by the user at creation time. ${Category}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The user-defined name of the private workbook. ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag]))] [System.Collections.Hashtable] # Resource etag ${Etag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Azure resource Id ${Id}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [System.String] - # The identity type. - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Resource location ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Configuration of this particular private workbook. # Configuration data is a string containing valid JSON ${SerializedData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Optional resourceId for a source resource. ${SourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # A list of 0 or more tags that are associated with this private workbook definition ${SourceTag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # BYOS Storage Account URI ${StorageUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Azure resource type ${Type}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # This instance's version of the data model. # This can change as new features are added that can be marked private workbook. ${Version}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2141,6 +2318,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2161,17 +2347,17 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsMyWorkbook_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsMyWorkbook_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsMyWorkbook_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind') ) { $PSBoundParameters['Kind'] = "user" } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -2181,6 +2367,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2261,7 +2450,7 @@ $data = @{ New-AzApplicationInsightsWorkbookTemplate -ResourceGroupName resourceGroup -Name 'workbooktemplate-pwsh01' -Location 'westus2' -Gallery $gallery -TemplateData $data -Priority 1 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate .Notes COMPLEX PARAMETER PROPERTIES @@ -2277,7 +2466,7 @@ GALLERY : Workbook galleries supported by the templa https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsworkbooktemplate #> function New-AzApplicationInsightsWorkbookTemplate { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -2300,55 +2489,66 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Resource location ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Information about the author of the workbook template. ${Author}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery[]] # Workbook galleries supported by the template. - # To construct, see NOTES section for GALLERY properties and create a hash table. ${Gallery}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized]))] [System.Collections.Hashtable] # Key value pair of localized gallery. # Each key is the locale code of languages supported by the Azure portal. ${Localized}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Priority of the template. # Determines which template to open when a workbook gallery is opened in viewer mode. ${Priority}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData]))] [System.Collections.Hashtable] # Valid JSON object containing workbook template payload. ${TemplateData}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2405,6 +2605,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2425,10 +2634,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbookTemplate_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbookTemplate_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbookTemplate_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2442,6 +2651,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2495,12 +2707,12 @@ $name = (New-Guid).ToString() New-AzApplicationInsightsWorkbook -ResourceGroupName appinsights-hkrs2v-test -Name $name -Location westus2 -DisplayName "$name-display" -SourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/appinsights-hkrs2v-test/providers/microsoft.insights/components/appinsights-48mah3-pwsh" -Category 'workbook' -SerializedData $null .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsworkbook #> function New-AzApplicationInsightsWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -2529,91 +2741,101 @@ param( # Azure Resource Id that will fetch all linked workbooks. ${LinkedSourceId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Workbook category, as defined by the user at creation time. ${Category}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The description of the workbook. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The user-defined name (display name) of the workbook. ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Resource etag ${Etag}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities]))] - [System.Collections.Hashtable] - # The set of user assigned identities associated with the resource. - # The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - # The dictionary values can be empty objects ({}) in requests. - ${IdentityUserAssignedIdentity}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Configuration of this particular workbook. # Configuration data is a string containing valid JSON ${SerializedData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # ResourceId for a source resource. ${SourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # Being deprecated, please use the other tags field ${SourceTag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The resourceId to the storage account when bring your own storage is used ${StorageUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String[]] + # The array of user assigned identities associated with the resource. + # The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + ${UserAssignedIdentity}, + + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData ${Version}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2670,6 +2892,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2690,17 +2921,17 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbook_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbook_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWorkbook_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind') ) { $PSBoundParameters['Kind'] = "shared" } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -2710,6 +2941,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2764,12 +2998,26 @@ Remove-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" - .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -2780,17 +3028,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightsapikey #> function Remove-AzApplicationInsightsApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityComponent', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The API Key ID. @@ -2822,9 +3071,14 @@ param( [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='DeleteViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2881,6 +3135,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2902,10 +3165,9 @@ begin { $mapping = @{ Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_DeleteViaIdentity'; + DeleteViaIdentityComponent = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_DeleteViaIdentityComponent'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2919,6 +3181,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2973,12 +3238,26 @@ Remove-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Nam .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -2989,17 +3268,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightscontinuousexport #> function Remove-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityComponent', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The Continuous Export configuration ID. @@ -3031,9 +3311,14 @@ param( [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='DeleteViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3090,6 +3375,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3111,10 +3405,9 @@ begin { $mapping = @{ Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_DeleteViaIdentity'; + DeleteViaIdentityComponent = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_DeleteViaIdentityComponent'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3128,6 +3421,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3198,7 +3494,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -3233,7 +3529,6 @@ param( [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()] @@ -3298,6 +3593,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3320,9 +3624,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsLinkedStorageAccount_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3336,6 +3638,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3478,6 +3783,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3499,9 +3813,7 @@ begin { $mapping = @{ Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsMyWorkbook_Delete'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3515,6 +3827,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3587,7 +3902,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -3622,7 +3937,6 @@ param( [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()] @@ -3687,6 +4001,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3709,9 +4032,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3725,6 +4046,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3797,7 +4121,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -3831,7 +4155,6 @@ param( [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()] @@ -3896,6 +4219,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3918,9 +4250,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWorkbookTemplate_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWorkbookTemplate_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3934,6 +4264,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4006,7 +4339,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -4040,7 +4373,6 @@ param( [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()] @@ -4105,6 +4437,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4127,9 +4468,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWorkbook_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWorkbook_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4143,6 +4482,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4213,7 +4555,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -4248,7 +4590,6 @@ param( [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()] @@ -4313,6 +4654,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4335,9 +4685,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsights_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsights_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4351,6 +4699,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4406,7 +4757,7 @@ Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Up .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts .Notes COMPLEX PARAMETER PROPERTIES @@ -4422,17 +4773,19 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightslinkedstorageaccount #> function Update-AzApplicationInsightsLinkedStorageAccount { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -4440,6 +4793,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -4447,6 +4802,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -4457,15 +4814,27 @@ param( [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()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Linked storage account resource ID ${LinkedStorageAccountResourceId}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -4522,6 +4891,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4543,10 +4921,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4560,6 +4938,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4605,18 +4986,18 @@ end { <# .Synopsis -Updates a private workbook that has already been added. +Update a new private workbook. .Description -Updates a private workbook that has already been added. +Update a new private workbook. .Example $myWorkbook = Get-AzApplicationInsightsMyWorkbook -ResourceGroupName "appinsights-hkrs2v-test" -Name "2e47417f-c136-44c0-b78f-7a4ca35fd9d1" $myWorkbook.DisplayName = "pwsh01" Update-AzApplicationInsightsMyWorkbook -ResourceGroupName "appinsights-hkrs2v-test" -Name "2e47417f-c136-44c0-b78f-7a4ca35fd9d1" -WorkbookProperty $myWorkbook .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook .Notes COMPLEX PARAMETER PROPERTIES @@ -4634,23 +5015,17 @@ WORKBOOKPROPERTY : An Application Insights private workbook definit [Type ]: Azure resource type [Category ]: Workbook category, as defined by the user at creation time. [DisplayName ]: The user-defined name of the private workbook. - [Kind ]: The kind of workbook. Choices are user and shared. - [PropertiesTag ]: A list of 0 or more tags that are associated with this private workbook definition + [Kind ]: The kind of workbook. Choices are user and shared. + [PropertiesTag >]: A list of 0 or more tags that are associated with this private workbook definition [SerializedData ]: Configuration of this particular private workbook. Configuration data is a string containing valid JSON [SourceId ]: Optional resourceId for a source resource. [StorageUri ]: BYOS Storage Account URI - [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). - [SystemDataCreatedBy ]: The identity that created the resource. - [SystemDataCreatedByType ]: The type of identity that created the resource. - [SystemDataLastModifiedAt ]: The timestamp of resource last modification (UTC) - [SystemDataLastModifiedBy ]: The identity that last modified the resource. - [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. [Version ]: This instance's version of the data model. This can change as new features are added that can be marked private workbook. .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightsmyworkbook #> function Update-AzApplicationInsightsMyWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook])] [CmdletBinding(DefaultParameterSetName='Update', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -4681,9 +5056,8 @@ param( [Parameter(Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook] # An Application Insights private workbook definition. - # To construct, see NOTES section for WORKBOOKPROPERTY properties and create a hash table. ${WorkbookProperty}, [Parameter()] @@ -4742,6 +5116,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4763,9 +5146,7 @@ begin { $mapping = @{ Update = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsMyWorkbook_Update'; } - if (('Update') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4779,6 +5160,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -4824,9 +5208,9 @@ end { <# .Synopsis -Updates the tags associated with an Application Insights web test. +Update the tags associated with an Application Insights web test. .Description -Updates the tags associated with an Application Insights web test. +Update the tags associated with an Application Insights web test. .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 @@ -4835,7 +5219,7 @@ Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest .Notes COMPLEX PARAMETER PROPERTIES @@ -4851,23 +5235,27 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightswebtesttag #> function Update-AzApplicationInsightsWebTestTag { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the Application Insights WebTest resource. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -4875,6 +5263,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -4885,16 +5275,28 @@ param( [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()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -4951,6 +5353,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4972,10 +5383,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -4989,6 +5400,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -5034,9 +5448,9 @@ end { <# .Synopsis -Updates a workbook template that has already been added. +Update a workbook template that has already been added. .Description -Updates a workbook template that has already been added. +Update a workbook template that has already been added. .Example Update-AzApplicationInsightsWorkbookTemplate -ResourceGroupName resourceGroup -Name workbooktemplate-pwsh01 -Tag @{'k1'='v1'} .Example @@ -5045,7 +5459,7 @@ Get-AzApplicationInsightsWorkbookTemplate -ResourceGroupName resourceGroup -Name .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate .Notes COMPLEX PARAMETER PROPERTIES @@ -5068,23 +5482,27 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightsworkbooktemplate #> function Update-AzApplicationInsightsWorkbookTemplate { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the Application Insights component resource. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -5092,6 +5510,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -5102,52 +5522,68 @@ param( [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()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Information about the author of the workbook template. ${Author}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery[]] # Workbook galleries supported by the template. - # To construct, see NOTES section for GALLERY properties and create a hash table. ${Gallery}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized]))] [System.Collections.Hashtable] # Key value pair of localized gallery. # Each key is the locale code of languages supported by the Azure portal. ${Localized}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Priority of the template. # Determines which template to open when a workbook gallery is opened in viewer mode. ${Priority}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData]))] [System.Collections.Hashtable] # Valid JSON object containing workbook template payload. ${TemplateData}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -5204,6 +5640,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -5225,10 +5670,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbookTemplate_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbookTemplate_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbookTemplate_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5242,6 +5687,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -5287,9 +5735,9 @@ end { <# .Synopsis -Updates a workbook that has already been added. +Update a workbook that has already been added. .Description -Updates a workbook that has already been added. +Update a workbook that has already been added. .Example Update-AzApplicationInsightsWorkbook -ResourceGroupName appinsights-hkrs2v-test -Name cc18e5e4-9558-4be1-b333-20b28aaca021 -DisplayName "workbook-portal" .Example @@ -5298,7 +5746,7 @@ Get-AzApplicationInsightsWorkbook -ResourceGroupName appinsights-hkrs2v-test -Na .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook .Notes COMPLEX PARAMETER PROPERTIES @@ -5314,23 +5762,27 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightsworkbook #> function Update-AzApplicationInsightsWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -5338,6 +5790,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -5348,7 +5802,6 @@ param( [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()] @@ -5357,51 +5810,70 @@ param( # Azure Resource Id that will fetch all linked workbooks. ${LinkedSourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Workbook category, as defined by the user at creation time. ${Category}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The description of the workbook. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The user-defined name (display name) of the workbook. ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The unique revision id for this workbook definition ${Revision}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Configuration of this particular workbook. # Configuration data is a string containing valid JSON ${SerializedData}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # A list of 0 or more tags that are associated with this workbook definition ${SourceTag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -5458,6 +5930,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -5479,17 +5960,17 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbook_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbook_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbook_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbook_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } - if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind')) { + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind') ) { $PSBoundParameters['Kind'] = "shared" } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -5499,6 +5980,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -5555,7 +6039,7 @@ Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePr .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Outputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan .Notes @@ -5563,7 +6047,7 @@ 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 +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [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. @@ -5573,14 +6057,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsights #> function Get-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent], [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent], [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PSApplicationInsightsComponentWithPricingPlan])] [CmdletBinding(DefaultParameterSetName='ListBySubscription', PositionalBinding=$false)] param( [Parameter(ParameterSetName='ListBySubscription')] @@ -5682,6 +6166,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -5707,9 +6200,7 @@ begin { GetByResourceId = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; GetByInputObject = 'Az.ApplicationInsights.custom\Get-AzApplicationInsights'; } - if (('ListBySubscription', 'ListByResourceGroupName', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('ListBySubscription', 'ListByResourceGroupName', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5723,6 +6214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -5777,12 +6271,12 @@ Note: You cannot specify a different value for InstrumentationKey nor AppId in t New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights #> function New-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -5814,6 +6308,7 @@ param( [Parameter()] [Alias('ApplicationKind')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other", "nodejs", "java", "ios", "store", "phone", "IgnoreCase")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The kind of application that this component refers to, used to customize UI. @@ -5821,9 +6316,9 @@ param( ${Kind}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + [System.String] # Type of application being monitored. ${ApplicationType}, @@ -5846,9 +6341,9 @@ param( ${Etag}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + [System.String] # 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}, @@ -5863,6 +6358,7 @@ param( [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. + # Please visit external url https://aka.ms/ewjuel to get more information. ${HockeyAppId}, [Parameter()] @@ -5872,30 +6368,30 @@ param( ${ImmediatePurgeDataOn30Day}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + [System.String] # Indicates the flow of the ingestion. ${IngestionMode}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights ingestion. ${PublicNetworkAccessForIngestion}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights query. ${PublicNetworkAccessForQuery}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + [System.String] # Describes what tool created this Application Insights component. # Customers using this API should set this to the default 'rest'. ${RequestSource}, @@ -5910,12 +6406,13 @@ param( [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. + # Please visit external url https://aka.ms/sl0yqd to get more information. ${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]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -5933,7 +6430,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -5983,6 +6481,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -6004,9 +6511,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ApplicationInsights.custom\New-AzApplicationInsights'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -6020,6 +6525,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -6075,12 +6583,12 @@ New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Des .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey #> function New-AzApplicationInsightsApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey])] [CmdletBinding(DefaultParameterSetName='ComponentNameParameterSet', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -6112,6 +6620,7 @@ param( [Parameter(Mandatory)] [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ReadTelemetry", "WriteAnnotations", "AuthenticateSDKControlChannel")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # The read access rights of this API Key. @@ -6122,7 +6631,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -6172,6 +6682,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -6193,9 +6712,7 @@ begin { $mapping = @{ ComponentNameParameterSet = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsApiKey'; } - if (('ComponentNameParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('ComponentNameParameterSet') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -6209,6 +6726,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -6258,6 +6778,7 @@ Create a Continuous Export configuration of an Application Insights component. .Description Create a Continuous Export configuration of an Application Insights component. .Example +$context = "*****" $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" ` @@ -6265,12 +6786,12 @@ New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " -StorageSASUri $sasuri -DestinationType Blob .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport #> function New-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -6344,7 +6865,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -6394,6 +6916,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -6415,9 +6946,7 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsContinuousExport'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -6431,6 +6960,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -6532,7 +7064,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwe " .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest .Notes COMPLEX PARAMETER PROPERTIES @@ -6548,7 +7080,7 @@ REQUESTHEADER : List of headers and their values to add to the W https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest #> function New-AzApplicationInsightsWebTest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest])] [CmdletBinding(DefaultParameterSetName='CreateStandard', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -6620,15 +7152,14 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.PSArgumentCompleterAttribute("ping", "multistep", "standard")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] + [System.String] # The kind of web test this is, valid choices are ping, multistep, and standard. ${Kind}, @@ -6647,9 +7178,8 @@ param( [Parameter(ParameterSetName='CreateStandard')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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')] @@ -6682,20 +7212,20 @@ param( # Validate that the WebTest returns the http status code provided. ${RuleExpectedHttpStatusCode}, - [Parameter(ParameterSetName='CreateStandard')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # When set, validation will ignore the status code. ${RuleIgnoreHttpsStatusCode}, - [Parameter(ParameterSetName='CreateStandard')] + [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(ParameterSetName='CreateStandard')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Checks to see if the SSL cert is still valid. @@ -6703,7 +7233,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -6732,7 +7262,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -6782,6 +7313,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -6804,9 +7344,7 @@ begin { CreateStandard = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; CreateClassic = 'Az.ApplicationInsights.custom\New-AzApplicationInsightsWebTest'; } - if (('CreateStandard', 'CreateClassic') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateStandard', 'CreateClassic') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -6820,6 +7358,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -6872,12 +7413,12 @@ Create an in-memory object for WebTestGeolocation. New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocation .Link -https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-AzApplicationInsightsWebTestGeolocationObject +https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-azapplicationinsightswebtestgeolocationobject #> function New-AzApplicationInsightsWebTestGeolocationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocation])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -6894,6 +7435,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -6922,6 +7466,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -6967,19 +7514,19 @@ end { <# .Synopsis -Create a in-memory object for HeaderField +Create an in-memory object for HeaderField. .Description -Create a in-memory object for HeaderField +Create an in-memory object for HeaderField. .Example New-AzApplicationInsightsWebTestHeaderFieldObject -Name 'version' -Value '2.0.1' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderField +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderField .Link -https://learn.microsoft.com/powershell/module/az.ApplicationInsights/new-AzApplicationInsightsWebTestHeaderFieldObject +https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-azapplicationinsightswebtestheaderfieldobject #> function New-AzApplicationInsightsWebTestHeaderFieldObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderField])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderField])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -7002,6 +7549,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -7030,6 +7580,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -7082,12 +7635,12 @@ Create an in-memory object for WorkbookTemplateGallery. New-AzApplicationInsightsWorkbookTemplateGalleryObject -Category "Failures" -Name "Simple Template" -Type 'tsg' -ResourceType "microsoft.insights/components" -Order 100 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGallery +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGallery .Link -https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-AzApplicationInsightsWorkbookTemplateGalleryObject +https://learn.microsoft.com/powershell/module/Az.ApplicationInsights/new-azapplicationinsightsworkbooktemplategalleryobject #> function New-AzApplicationInsightsWorkbookTemplateGalleryObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGallery])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGallery])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -7128,6 +7681,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -7156,6 +7712,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -7205,6 +7764,7 @@ Create a Continuous Export configuration of an Application Insights component. .Description Create a Continuous Export configuration of an Application Insights component. .Example +$context = "*****" $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" ` @@ -7212,12 +7772,12 @@ Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " -StorageSASUri $sasuri -DestinationType Blob .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscontinuousexport #> function Set-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -7303,7 +7863,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -7353,6 +7914,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -7374,9 +7944,7 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsContinuousExport'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -7390,6 +7958,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -7442,12 +8013,12 @@ Update current billing features for an Application Insights component. Set-AzApplicationInsightsDailyCap -ResourceGroupName "testgroup" -Name "test" -DailyCapGB 400 -DisableNotificationWhenHitCap .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightsdailycap #> function Set-AzApplicationInsightsDailyCap { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -7538,6 +8109,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -7559,9 +8139,7 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsDailyCap'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -7575,6 +8153,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -7627,12 +8208,12 @@ Update current billing features for an Application Insights component. Set-AzApplicationInsightsPricingPlan -ResourceGroupName "testgroup" -Name "test" -PricingPlan "Basic" -DailyCapGB 400 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightspricingplan #> function Set-AzApplicationInsightsPricingPlan { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -7658,6 +8239,7 @@ param( [Parameter()] [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Basic", "Application Insights Enterprise", "Limited Basic")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Current enabled pricing plan. @@ -7681,7 +8263,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -7731,6 +8314,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -7752,9 +8344,7 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsPricingPlan'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -7768,6 +8358,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -7822,12 +8415,12 @@ Note: You cannot specify a different value for InstrumentationKey nor AppId in t Update-AzApplicationInsights -ResourceGroupName "rgName" -Name "aiName" -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsights #> function Update-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -7852,9 +8445,9 @@ param( ${SubscriptionId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + [System.String] # Type of application being monitored. ${ApplicationType}, @@ -7877,9 +8470,9 @@ param( ${Etag}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + [System.String] # 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}, @@ -7903,30 +8496,30 @@ param( ${ImmediatePurgeDataOn30Day}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + [System.String] # Indicates the flow of the ingestion. ${IngestionMode}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights ingestion. ${PublicNetworkAccessForIngestion}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights query. ${PublicNetworkAccessForQuery}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + [System.String] # Describes what tool created this Application Insights component. # Customers using this API should set this to the default 'rest'. ${RequestSource}, @@ -7946,7 +8539,7 @@ param( [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]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -8014,6 +8607,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -8035,9 +8637,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ApplicationInsights.custom\Update-AzApplicationInsights'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -8051,6 +8651,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsights.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsights.ps1 index 1c0213f1c962..ea52e4c210e9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsights.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsights.ps1 @@ -41,7 +41,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -76,7 +76,6 @@ param( [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()] @@ -141,6 +140,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -163,9 +171,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsights_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsights_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -179,6 +185,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsApiKey.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsApiKey.ps1 index 9d8a6f19665c..6e0ea24e29fd 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsApiKey.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsApiKey.ps1 @@ -25,12 +25,26 @@ Remove-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" - .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -41,17 +55,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightsapikey #> function Remove-AzApplicationInsightsApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityComponent', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The API Key ID. @@ -83,9 +98,14 @@ param( [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='DeleteViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -142,6 +162,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -163,10 +192,9 @@ begin { $mapping = @{ Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_DeleteViaIdentity'; + DeleteViaIdentityComponent = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsApiKey_DeleteViaIdentityComponent'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -180,6 +208,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsContinuousExport.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsContinuousExport.ps1 index b063d2a25e51..3d7fe56fcdfb 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsContinuousExport.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsContinuousExport.ps1 @@ -25,12 +25,26 @@ Remove-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Nam .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -41,17 +55,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/remove-azapplicationinsightscontinuousexport #> function Remove-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityComponent', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The Continuous Export configuration ID. @@ -83,9 +98,14 @@ param( [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='DeleteViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -142,6 +162,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -163,10 +192,9 @@ begin { $mapping = @{ Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_DeleteViaIdentity'; + DeleteViaIdentityComponent = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsContinuousExport_DeleteViaIdentityComponent'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -180,6 +208,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsLinkedStorageAccount.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsLinkedStorageAccount.ps1 index 125268fa9941..c48b5c1dad17 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsLinkedStorageAccount.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsLinkedStorageAccount.ps1 @@ -41,7 +41,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -76,7 +76,6 @@ param( [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()] @@ -141,6 +140,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -163,9 +171,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsLinkedStorageAccount_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -179,6 +185,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsMyWorkbook.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsMyWorkbook.ps1 index 846c6fadb046..b882ea7804d3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsMyWorkbook.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsMyWorkbook.ps1 @@ -113,6 +113,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -134,9 +143,7 @@ begin { $mapping = @{ Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsMyWorkbook_Delete'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -150,6 +157,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWebTest.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWebTest.ps1 index f2b219f8b7e1..ea6e2b42696f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWebTest.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWebTest.ps1 @@ -43,7 +43,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -78,7 +78,6 @@ param( [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()] @@ -143,6 +142,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -165,9 +173,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWebTest_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -181,6 +187,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWorkbook.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWorkbook.ps1 index eba0dc86cf49..d84519154882 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWorkbook.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWorkbook.ps1 @@ -43,7 +43,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -77,7 +77,6 @@ param( [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()] @@ -142,6 +141,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -164,9 +172,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWorkbook_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWorkbook_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -180,6 +186,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWorkbookTemplate.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWorkbookTemplate.ps1 index fc310250a569..82f26a053910 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWorkbookTemplate.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Remove-AzApplicationInsightsWorkbookTemplate.ps1 @@ -43,7 +43,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -77,7 +77,6 @@ param( [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()] @@ -142,6 +141,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -164,9 +172,7 @@ begin { Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWorkbookTemplate_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsWorkbookTemplate_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -180,6 +186,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsContinuousExport.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsContinuousExport.ps1 index ff0d8387eb92..18dae4983196 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsContinuousExport.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsContinuousExport.ps1 @@ -20,6 +20,7 @@ Create a Continuous Export configuration of an Application Insights component. .Description Create a Continuous Export configuration of an Application Insights component. .Example +$context = "*****" $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" ` @@ -27,12 +28,12 @@ Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " -StorageSASUri $sasuri -DestinationType Blob .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscontinuousexport #> function Set-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -118,7 +119,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -168,6 +170,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -189,9 +200,7 @@ begin { $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsContinuousExport'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -205,6 +214,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsDailyCap.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsDailyCap.ps1 index 3229e7bc9f66..1b15aea106a2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsDailyCap.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsDailyCap.ps1 @@ -23,12 +23,12 @@ Update current billing features for an Application Insights component. Set-AzApplicationInsightsDailyCap -ResourceGroupName "testgroup" -Name "test" -DailyCapGB 400 -DisableNotificationWhenHitCap .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightsdailycap #> function Set-AzApplicationInsightsDailyCap { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -119,6 +119,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -140,9 +149,7 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsDailyCap'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -156,6 +163,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsPricingPlan.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsPricingPlan.ps1 index 97f94d6ad2cb..0fe661bab8bb 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsPricingPlan.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Set-AzApplicationInsightsPricingPlan.ps1 @@ -23,12 +23,12 @@ Update current billing features for an Application Insights component. Set-AzApplicationInsightsPricingPlan -ResourceGroupName "testgroup" -Name "test" -PricingPlan "Basic" -DailyCapGB 400 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightspricingplan #> function Set-AzApplicationInsightsPricingPlan { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -54,6 +54,7 @@ param( [Parameter()] [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Basic", "Application Insights Enterprise", "Limited Basic")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Current enabled pricing plan. @@ -77,7 +78,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -127,6 +129,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -148,9 +159,7 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.custom\Set-AzApplicationInsightsPricingPlan'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -164,6 +173,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsights.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsights.ps1 index 25b9b72615fe..7e7ba9ecf052 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsights.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsights.ps1 @@ -25,12 +25,12 @@ Note: You cannot specify a different value for InstrumentationKey nor AppId in t Update-AzApplicationInsights -ResourceGroupName "rgName" -Name "aiName" -PublicNetworkAccessForIngestion "Disabled" -PublicNetworkAccessForQuery "Disabled" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsights #> function Update-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -55,9 +55,9 @@ param( ${SubscriptionId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + [System.String] # Type of application being monitored. ${ApplicationType}, @@ -80,9 +80,9 @@ param( ${Etag}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + [System.String] # 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}, @@ -106,30 +106,30 @@ param( ${ImmediatePurgeDataOn30Day}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + [System.String] # Indicates the flow of the ingestion. ${IngestionMode}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights ingestion. ${PublicNetworkAccessForIngestion}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights query. ${PublicNetworkAccessForQuery}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + [System.String] # Describes what tool created this Application Insights component. # Customers using this API should set this to the default 'rest'. ${RequestSource}, @@ -149,7 +149,7 @@ param( [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]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -217,6 +217,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -238,9 +247,7 @@ begin { $mapping = @{ __AllParameterSets = 'Az.ApplicationInsights.custom\Update-AzApplicationInsights'; } - if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -254,6 +261,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsLinkedStorageAccount.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsLinkedStorageAccount.ps1 index aab4cb8243d3..129cff21956d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsLinkedStorageAccount.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsLinkedStorageAccount.ps1 @@ -26,7 +26,7 @@ Get-AzApplicationInsights -ResourceGroupName "rgName" -Name "componentName" | Up .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts .Notes COMPLEX PARAMETER PROPERTIES @@ -42,17 +42,19 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightslinkedstorageaccount #> function Update-AzApplicationInsightsLinkedStorageAccount { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -60,6 +62,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -67,6 +71,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -77,15 +83,27 @@ param( [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()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Linked storage account resource ID ${LinkedStorageAccountResourceId}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -142,6 +160,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -163,10 +190,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsLinkedStorageAccount_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -180,6 +207,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsMyWorkbook.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsMyWorkbook.ps1 index c5bbf956aa63..bb85a3587cde 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsMyWorkbook.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsMyWorkbook.ps1 @@ -16,18 +16,18 @@ <# .Synopsis -Updates a private workbook that has already been added. +Update a new private workbook. .Description -Updates a private workbook that has already been added. +Update a new private workbook. .Example $myWorkbook = Get-AzApplicationInsightsMyWorkbook -ResourceGroupName "appinsights-hkrs2v-test" -Name "2e47417f-c136-44c0-b78f-7a4ca35fd9d1" $myWorkbook.DisplayName = "pwsh01" Update-AzApplicationInsightsMyWorkbook -ResourceGroupName "appinsights-hkrs2v-test" -Name "2e47417f-c136-44c0-b78f-7a4ca35fd9d1" -WorkbookProperty $myWorkbook .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook .Notes COMPLEX PARAMETER PROPERTIES @@ -45,23 +45,17 @@ WORKBOOKPROPERTY : An Application Insights private workbook definit [Type ]: Azure resource type [Category ]: Workbook category, as defined by the user at creation time. [DisplayName ]: The user-defined name of the private workbook. - [Kind ]: The kind of workbook. Choices are user and shared. - [PropertiesTag ]: A list of 0 or more tags that are associated with this private workbook definition + [Kind ]: The kind of workbook. Choices are user and shared. + [PropertiesTag >]: A list of 0 or more tags that are associated with this private workbook definition [SerializedData ]: Configuration of this particular private workbook. Configuration data is a string containing valid JSON [SourceId ]: Optional resourceId for a source resource. [StorageUri ]: BYOS Storage Account URI - [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). - [SystemDataCreatedBy ]: The identity that created the resource. - [SystemDataCreatedByType ]: The type of identity that created the resource. - [SystemDataLastModifiedAt ]: The timestamp of resource last modification (UTC) - [SystemDataLastModifiedBy ]: The identity that last modified the resource. - [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. [Version ]: This instance's version of the data model. This can change as new features are added that can be marked private workbook. .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightsmyworkbook #> function Update-AzApplicationInsightsMyWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook])] [CmdletBinding(DefaultParameterSetName='Update', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -92,9 +86,8 @@ param( [Parameter(Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook] # An Application Insights private workbook definition. - # To construct, see NOTES section for WORKBOOKPROPERTY properties and create a hash table. ${WorkbookProperty}, [Parameter()] @@ -153,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -174,9 +176,7 @@ begin { $mapping = @{ Update = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsMyWorkbook_Update'; } - if (('Update') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -190,6 +190,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWebTestTag.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWebTestTag.ps1 index f53871c52df1..930391b5f2b3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWebTestTag.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWebTestTag.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Updates the tags associated with an Application Insights web test. +Update the tags associated with an Application Insights web test. .Description -Updates the tags associated with an Application Insights web test. +Update the tags associated with an Application Insights web test. .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 @@ -27,7 +27,7 @@ Get-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -WebTestName .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest .Notes COMPLEX PARAMETER PROPERTIES @@ -43,23 +43,27 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightswebtesttag #> function Update-AzApplicationInsightsWebTestTag { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the Application Insights WebTest resource. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -67,6 +71,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -77,16 +83,28 @@ param( [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()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -143,6 +161,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -164,10 +191,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWebTestTag_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -181,6 +208,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWorkbook.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWorkbook.ps1 index 93b819c39424..9ec1db4d57f2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWorkbook.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWorkbook.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Updates a workbook that has already been added. +Update a workbook that has already been added. .Description -Updates a workbook that has already been added. +Update a workbook that has already been added. .Example Update-AzApplicationInsightsWorkbook -ResourceGroupName appinsights-hkrs2v-test -Name cc18e5e4-9558-4be1-b333-20b28aaca021 -DisplayName "workbook-portal" .Example @@ -27,7 +27,7 @@ Get-AzApplicationInsightsWorkbook -ResourceGroupName appinsights-hkrs2v-test -Na .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook .Notes COMPLEX PARAMETER PROPERTIES @@ -43,23 +43,27 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightsworkbook #> function Update-AzApplicationInsightsWorkbook { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -67,6 +71,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -77,7 +83,6 @@ param( [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()] @@ -86,51 +91,70 @@ param( # Azure Resource Id that will fetch all linked workbooks. ${LinkedSourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Workbook category, as defined by the user at creation time. ${Category}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The description of the workbook. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The user-defined name (display name) of the workbook. ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The unique revision id for this workbook definition ${Revision}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Configuration of this particular workbook. # Configuration data is a string containing valid JSON ${SerializedData}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # A list of 0 or more tags that are associated with this workbook definition ${SourceTag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -187,6 +211,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -208,17 +241,17 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbook_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbook_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbook_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbook_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } - if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind')) { + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('Kind') ) { $PSBoundParameters['Kind'] = "shared" } $cmdInfo = Get-Command -Name $mapping[$parameterSet] @@ -228,6 +261,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWorkbookTemplate.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWorkbookTemplate.ps1 index f75040042006..91c8269b5839 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWorkbookTemplate.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/exports/Update-AzApplicationInsightsWorkbookTemplate.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Updates a workbook template that has already been added. +Update a workbook template that has already been added. .Description -Updates a workbook template that has already been added. +Update a workbook template that has already been added. .Example Update-AzApplicationInsightsWorkbookTemplate -ResourceGroupName resourceGroup -Name workbooktemplate-pwsh01 -Tag @{'k1'='v1'} .Example @@ -27,7 +27,7 @@ Get-AzApplicationInsightsWorkbookTemplate -ResourceGroupName resourceGroup -Name .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate .Notes COMPLEX PARAMETER PROPERTIES @@ -50,23 +50,27 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightsworkbooktemplate #> function Update-AzApplicationInsightsWorkbookTemplate { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the Application Insights component resource. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -74,6 +78,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -84,52 +90,68 @@ param( [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()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Information about the author of the workbook template. ${Author}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery[]] # Workbook galleries supported by the template. - # To construct, see NOTES section for GALLERY properties and create a hash table. ${Gallery}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized]))] [System.Collections.Hashtable] # Key value pair of localized gallery. # Each key is the locale code of languages supported by the Azure portal. ${Localized}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Priority of the template. # Determines which template to open when a workbook gallery is opened in viewer mode. ${Priority}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData]))] [System.Collections.Hashtable] # Valid JSON object containing workbook template payload. ${TemplateData}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -186,6 +208,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -207,10 +238,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbookTemplate_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbookTemplate_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsWorkbookTemplate_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -224,6 +255,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generate-info.json b/generated/ApplicationInsights/ApplicationInsights.Autorest/generate-info.json index baf7dd351d50..c72cfa18107f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generate-info.json +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "e79f3301-10cb-4d98-b19c-248daa9a6880" + "generate_Id": "02cdd05d-044a-4016-86a9-d72f1c4041b2" } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/Module.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/Module.cs index cb8798cc7783..7ef25267c4fb 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/Module.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/Module.cs @@ -28,12 +28,20 @@ public partial class Module public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + private static bool _init = false; + + private static readonly global::System.Object _initLock = new global::System.Object(); + + private static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } } /// The Name of this module public string Name => @"Az.ApplicationInsights"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeli /// Initialization steps performed after the module is loaded. public void Init() { - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); - CustomInit(); + if (_init == false) + { + lock (_initLock) { + if (_init == false) { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + _init = true; + } + } + } } /// Creates the module instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/ApplicationInsightsManagementClient.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/ApplicationInsightsManagementClient.cs index a52adbdd9a85..604e0c908f4b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/ApplicationInsightsManagementClient.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/ApplicationInsightsManagementClient.cs @@ -14,9 +14,9 @@ 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. + /// create an Annotation of an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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). @@ -24,10 +24,11 @@ public partial class ApplicationInsightsManagementClient /// 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task AnnotationsCreate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -55,15 +56,15 @@ public partial class ApplicationInsightsManagementClient 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 = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AnnotationsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.AnnotationsCreate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create an Annotation of an Application Insights component. + /// 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). @@ -71,10 +72,11 @@ public partial class ApplicationInsightsManagementClient /// 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task AnnotationsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -89,8 +91,66 @@ public partial class ApplicationInsightsManagementClient } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task> AnnotationsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -105,6 +165,55 @@ public partial class ApplicationInsightsManagementClient + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AnnotationsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create an Annotation of an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the AnnotationsCreate 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 AnnotationsCreateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.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 @@ -114,15 +223,170 @@ public partial class ApplicationInsightsManagementClient 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 = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AnnotationsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.AnnotationsCreate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// create an Annotation of an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the AnnotationsCreate operation + /// 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> AnnotationsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AnnotationsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create an Annotation of an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task> AnnotationsCreateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AnnotationsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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> AnnotationsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _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.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Annotation.FromJson(__x) )) ))() : null); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -132,7 +396,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 ) { @@ -143,6 +407,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -150,13 +415,13 @@ public partial class ApplicationInsightsManagementClient 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)); + 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.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -175,23 +440,23 @@ public partial class ApplicationInsightsManagementClient /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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) + internal async global::System.Threading.Tasks.Task AnnotationsCreate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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); @@ -199,8 +464,8 @@ public partial class ApplicationInsightsManagementClient } /// 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 resource group. The name is case insensitive. /// 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). @@ -209,7 +474,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + public async global::System.Threading.Tasks.Task AnnotationsDelete(string subscriptionId, string resourceGroupName, 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 @@ -238,7 +503,7 @@ public partial class ApplicationInsightsManagementClient 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); + await this.AnnotationsDelete_Call (request, onOk,eventListener,sender); } } @@ -265,8 +530,8 @@ public partial class ApplicationInsightsManagementClient } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; var annotationId = _match.Groups["annotationId"].Value; // construct URL @@ -292,11 +557,11 @@ public partial class ApplicationInsightsManagementClient 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); + await this.AnnotationsDelete_Call (request, onOk,eventListener,sender); } } - /// Actual wire call for method. + /// 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. @@ -315,6 +580,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -345,31 +611,31 @@ public partial class ApplicationInsightsManagementClient /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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) + internal async global::System.Threading.Tasks.Task AnnotationsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string annotationId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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 resource group. The name is case insensitive. /// 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). @@ -380,7 +646,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + public async global::System.Threading.Tasks.Task AnnotationsGet(string subscriptionId, string resourceGroupName, 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 @@ -409,7 +675,7 @@ public partial class ApplicationInsightsManagementClient 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); + await this.AnnotationsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -423,7 +689,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 @@ -438,8 +704,8 @@ public partial class ApplicationInsightsManagementClient } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; var annotationId = _match.Groups["annotationId"].Value; // construct URL @@ -465,100 +731,76 @@ public partial class ApplicationInsightsManagementClient 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); + 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). + /// Get the annotation for given id. + /// /// 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. + /// 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) + public async global::System.Threading.Tasks.Task> AnnotationsGetViaIdentityWithResult(global::System.String viaIdentity, 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 ) { - 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}'"); } - } - } - /// - /// Validation method for method. Call 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.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertNotNull(nameof(annotationId),annotationId); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AnnotationsGetWithResult_Call (request, eventListener,sender); } } - /// Gets the list of annotations for a component for given time range - /// The name of the resource group. The name is case insensitive. + /// Get the annotation for given id. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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). + /// The unique annotation ID. This is unique within a Application Insights component. /// 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. + /// 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) + public async global::System.Threading.Tasks.Task> AnnotationsGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, string annotationId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -572,89 +814,86 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/Annotations" + + "/Annotations/" + + global::System.Uri.EscapeDataString(annotationId) + "?" + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.AnnotationsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.AnnotationsGetWithResult_Call (request, 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// 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. + /// 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) + internal async global::System.Threading.Tasks.Task> AnnotationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 + 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - 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) + 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 null; } + var _result = _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.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Annotation.FromJson(__x) )) ))() : null); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -664,7 +903,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 ) { @@ -675,6 +914,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -682,13 +922,13 @@ public partial class ApplicationInsightsManagementClient 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)) )); + 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.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -704,45 +944,46 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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. + /// 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 AnnotationsList_Validate(string resourceGroupName, string subscriptionId, string resourceName, string start, string end, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AnnotationsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string annotationId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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); + await eventListener.AssertNotNull(nameof(annotationId),annotationId); } } - /// Create an API Key of an Application Insights component. - /// The name of the resource group. The name is case insensitive. + /// Gets the list of annotations for a component for given time range /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. - /// Properties that need to be specified to create an API key of a Application Insights component. + /// 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 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) + public async global::System.Threading.Tasks.Task AnnotationsList(string subscriptionId, string resourceGroupName, 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 @@ -756,38 +997,41 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/ApiKeys" + + "/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.Post, _url); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + await this.AnnotationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create an API Key of an Application Insights component. + /// Gets the list of annotations for a component for given time range /// - /// Properties that need to be specified to create an API key of a Application Insights component. + /// 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 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) + 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 @@ -795,15 +1039,15 @@ public partial class ApplicationInsightsManagementClient { // 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); + 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}/ApiKeys'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -813,112 +1057,99 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/ApiKeys" + + "/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.Post, _url); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + 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). + /// 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. /// 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. + /// 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) + public async global::System.Threading.Tasks.Task AnnotationsListViaIdentityWithResult(global::System.String viaIdentity, string start, string end, 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 ) { - 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations'"); } - } - } - /// - /// Validation method for method. Call 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.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); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AnnotationsListWithResult_Call (request, eventListener,sender); } } - /// Delete an API Key of an Application Insights component. - /// The name of the resource group. The name is case insensitive. + /// Gets the list of annotations for a component for given time range /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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). + /// 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. /// 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. + /// 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) + public async global::System.Threading.Tasks.Task AnnotationsListWithResult(string subscriptionId, string resourceGroupName, string resourceName, string start, string end, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -932,88 +1163,99 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/APIKeys/" - + global::System.Uri.EscapeDataString(keyId) + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApiKeysDelete_Call(request,onOk,eventListener,sender); + return await this.AnnotationsListWithResult_Call (request, eventListener,sender); } } - /// Delete an API Key of an Application Insights component. - /// - /// a delegate that is called when the remote service returns 200 (OK). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// 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. + /// 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) + internal async global::System.Threading.Tasks.Task AnnotationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 + 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - 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) + 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 null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 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) + 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 ) { @@ -1024,6 +1266,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1031,12 +1274,14 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { - throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + 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.AnnotationError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } } } @@ -1051,43 +1296,46 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// The name of the Application Insights component resource. - /// The API Key ID. This is unique within a Application Insights component. + /// 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 ApiKeysDelete_Validate(string resourceGroupName, string subscriptionId, string resourceName, string keyId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AnnotationsList_Validate(string subscriptionId, string resourceGroupName, string resourceName, string start, string end, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertNotNull(nameof(keyId),keyId); + await eventListener.AssertNotNull(nameof(start),start); + await eventListener.AssertNotNull(nameof(end),end); } } - /// Get the API Key for this key id. - /// The name of the resource group. The name is case insensitive. + /// create an API Key of an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. - /// The API Key ID. This is unique within a 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task ApiKeysCreate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -1101,8 +1349,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/APIKeys/" - + global::System.Uri.EscapeDataString(keyId) + + "/ApiKeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1111,24 +1358,30 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApiKeysGet_Call(request,onOk,eventListener,sender); + await this.ApiKeysCreate_Call (request, onOk,eventListener,sender); } } - /// Get the API Key for this key id. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task ApiKeysCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -1136,17 +1389,16 @@ public partial class ApplicationInsightsManagementClient { // 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); + 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/{keyId}'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var keyId = _match.Groups["keyId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1155,8 +1407,7 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/APIKeys/" - + keyId + + "/ApiKeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1165,97 +1416,89 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApiKeysGet_Call(request,onOk,eventListener,sender); + 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). + /// 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. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// 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) + public async global::System.Threading.Tasks.Task ApiKeysCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2015-05-01"; + // Constant Parameters 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}'"); } - } - } - /// - /// Validation method for method. Call 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.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertNotNull(nameof(keyId),keyId); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApiKeysCreateWithResult_Call (request, eventListener,sender); } } - /// Gets a list of API keys of an Application Insights component. - /// The name of the resource group. The name is case insensitive. + /// create an API Key of an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. + /// Json string supplied to the ApiKeysCreate operation /// 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) + public async global::System.Threading.Tasks.Task ApiKeysCreateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, 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 @@ -1278,147 +1521,79 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // make the call - await this.ApiKeysList_Call(request,onOk,eventListener,sender); + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApiKeysCreate_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). + /// create an API Key of an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the ApiKeysCreate operation /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ApiKeysCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, 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 + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" - + resourceName + + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // 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(); - } + return await this.ApiKeysCreateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// The name of the resource group. The name is case insensitive. + /// create an API Key of an Application Insights component. /// 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.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). + /// Properties that need to be specified to create an API key of a Application Insights component. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// 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) + public async global::System.Threading.Tasks.Task ApiKeysCreateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -1432,77 +1607,75 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/getavailablebillingfeatures" + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentAvailableFeaturesGet_Call(request,onOk,eventListener,sender); + return await this.ApiKeysCreateWithResult_Call (request, eventListener,sender); } } - /// Returns all available features of the application insights component. - /// - /// a delegate that is called when the remote service returns 200 (OK). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// 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. + /// 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) + internal async global::System.Threading.Tasks.Task ApiKeysCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 + 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - 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) + 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 null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/getavailablebillingfeatures'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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. + /// 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. @@ -1510,7 +1683,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 ) { @@ -1521,6 +1694,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1528,7 +1702,7 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -1548,40 +1722,44 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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 ComponentAvailableFeaturesGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApiKeysCreate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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 current billing features for an Application Insights component. - /// The name of the resource group. The name is case insensitive. + /// Delete an API Key of an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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 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) + public async global::System.Threading.Tasks.Task ApiKeysDelete(string subscriptionId, string resourceGroupName, 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 @@ -1595,7 +1773,8 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/currentbillingfeatures" + + "/APIKeys/" + + global::System.Uri.EscapeDataString(keyId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1604,16 +1783,16 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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.ComponentCurrentBillingFeaturesGet_Call(request,onOk,eventListener,sender); + await this.ApiKeysDelete_Call (request, onOk,eventListener,sender); } } - /// Returns current billing features for an Application Insights component. + /// 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. @@ -1621,7 +1800,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 @@ -1629,16 +1808,17 @@ public partial class ApplicationInsightsManagementClient { // 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); + 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}/currentbillingfeatures'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; + var keyId = _match.Groups["keyId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1647,7 +1827,8 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/currentbillingfeatures" + + "/APIKeys/" + + keyId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1656,96 +1837,81 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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.ComponentCurrentBillingFeaturesGet_Call(request,onOk,eventListener,sender); + 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). + /// Delete an API Key of an Application Insights component. + /// /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ApiKeysDeleteViaIdentityWithResult(global::System.String viaIdentity, 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 ) { - 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}'"); } - } - } - /// - /// Validation method for method. Call 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.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApiKeysDeleteWithResult_Call (request, eventListener,sender); } } - /// Update current billing features for an Application Insights component. - /// The name of the resource group. The name is case insensitive. + /// Delete an API Key of an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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). + /// The API Key ID. This is unique within a Application Insights component. /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ApiKeysDeleteWithResult(string subscriptionId, string resourceGroupName, string resourceName, string keyId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -1759,88 +1925,72 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/currentbillingfeatures" + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentCurrentBillingFeaturesUpdate_Call(request,onOk,eventListener,sender); + return await this.ApiKeysDeleteWithResult_Call (request, 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// 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. + /// 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) + internal async global::System.Threading.Tasks.Task ApiKeysDeleteWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 + 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - 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) + 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 null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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. - /// + /// 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. @@ -1848,7 +1998,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 ) { @@ -1859,6 +2009,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1866,7 +2017,7 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -1886,43 +2037,43 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// The name of the Application Insights component resource. - /// Properties that need to be specified to update billing features for an Application Insights component. + /// 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 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) + internal async global::System.Threading.Tasks.Task ApiKeysDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string keyId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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); + await eventListener.AssertNotNull(nameof(keyId),keyId); } } - /// Returns feature capabilities of the application insights component. - /// The name of the resource group. The name is case insensitive. + /// Get the API Key for this key id. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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 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) + public async global::System.Threading.Tasks.Task ApiKeysGet(string subscriptionId, string resourceGroupName, 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 @@ -1936,7 +2087,8 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/featurecapabilities" + + "/APIKeys/" + + global::System.Uri.EscapeDataString(keyId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1950,11 +2102,11 @@ public partial class ApplicationInsightsManagementClient 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); + await this.ApiKeysGet_Call (request, onOk,eventListener,sender); } } - /// Returns feature capabilities of the application insights component. + /// 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. @@ -1962,7 +2114,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 @@ -1970,16 +2122,17 @@ public partial class ApplicationInsightsManagementClient { // 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); + 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}/featurecapabilities'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; + var keyId = _match.Groups["keyId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1988,7 +2141,8 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/featurecapabilities" + + "/APIKeys/" + + keyId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2002,19 +2156,117 @@ public partial class ApplicationInsightsManagementClient 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); + await this.ApiKeysGet_Call (request, onOk,eventListener,sender); + } + } + + /// Get the API Key for this key id. + /// + /// 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 ApiKeysGetViaIdentityWithResult(global::System.String viaIdentity, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApiKeysGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the API Key for this key id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// 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 ApiKeysGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, string keyId, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApiKeysGetWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// 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. + /// 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) + internal async global::System.Threading.Tasks.Task ApiKeysGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2022,18 +2274,19 @@ public partial class ApplicationInsightsManagementClient try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { case global::System.Net.HttpStatusCode.OK: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKey.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { @@ -2051,48 +2304,91 @@ public partial class ApplicationInsightsManagementClient } } - /// - /// Validation method for method. Call 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. + /// 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 ComponentFeatureCapabilitiesGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApiKeysGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string keyId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(keyId),keyId); } } - /// Replace current linked storage account for an Application Insights component. - /// The name of the resource group. The name is case insensitive. + /// Gets a list of API keys of an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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) + public async global::System.Threading.Tasks.Task ApiKeysList(string subscriptionId, string resourceGroupName, 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 = @"2020-03-01-preview"; - var storageType = @"ServiceProfiler"; + var apiVersion = @"2015-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2104,8 +2400,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/linkedStorageAccounts/" - + global::System.Uri.EscapeDataString(storageType) + + "/ApiKeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2114,50 +2409,41 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + await this.ApiKeysList_Call (request, onOk,eventListener,sender); } } - /// Replace current linked storage account for an Application Insights component. + /// Gets a list of API keys of 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) + 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 = @"2020-03-01-preview"; + 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/(?[^/]+)/linkedStorageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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}/linkedStorageAccounts/{storageType}'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var storageType = _match.Groups["storageType"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2166,8 +2452,7 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/linkedStorageAccounts/" - + storageType + + "/ApiKeys" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2176,32 +2461,164 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + await this.ApiKeysList_Call (request, onOk,eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Gets a list of API keys of an Application Insights component. + /// + /// 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 ApiKeysListViaIdentityWithResult(global::System.String viaIdentity, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApiKeysListWithResult_Call (request, eventListener,sender); + } + } + + /// Gets a list of API keys of an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// 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 ApiKeysListWithResult(string subscriptionId, string resourceGroupName, string resourceName, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApiKeysListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ApiKeysListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKeyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } + } + } + + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the 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) + 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 ) { @@ -2212,6 +2629,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2219,14 +2637,12 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKeyListResult.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; + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); } } } @@ -2241,50 +2657,42 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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) + internal async global::System.Threading.Tasks.Task ApiKeysList_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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. + /// Returns all available features of the application insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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) + public async global::System.Threading.Tasks.Task ComponentAvailableFeaturesGet(string subscriptionId, string resourceGroupName, 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 = @"2020-03-01-preview"; - var storageType = @"ServiceProfiler"; + var apiVersion = @"2015-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2296,8 +2704,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/linkedStorageAccounts/" - + global::System.Uri.EscapeDataString(storageType) + + "/getavailablebillingfeatures" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2306,45 +2713,41 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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.ComponentLinkedStorageAccountsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ComponentAvailableFeaturesGet_Call (request, onOk,eventListener,sender); } } - /// Delete linked storage accounts for an Application Insights component. + /// Returns all available features of the 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) + 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 = @"2020-03-01-preview"; + 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/(?[^/]+)/linkedStorageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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}/linkedStorageAccounts/{storageType}'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var storageType = _match.Groups["storageType"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2353,8 +2756,7 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/linkedStorageAccounts/" - + storageType + + "/getavailablebillingfeatures" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2363,115 +2765,80 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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.ComponentLinkedStorageAccountsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + 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). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Returns all available features of the application insights component. + /// /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentAvailableFeaturesGetViaIdentityWithResult(global::System.String viaIdentity, 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 ) { - 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/getavailablebillingfeatures'"); } - } - } - /// - /// Validation method for method. Call 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); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentAvailableFeaturesGetWithResult_Call (request, eventListener,sender); } } - /// - /// Returns the current linked storage settings for an Application Insights component. - /// - /// The name of the resource group. The name is case insensitive. + /// Returns all available features of the application insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentAvailableFeaturesGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, 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"; + var apiVersion = @"2015-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2483,94 +2850,81 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/linkedStorageAccounts/" - + global::System.Uri.EscapeDataString(storageType) + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentLinkedStorageAccountsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.ComponentAvailableFeaturesGetWithResult_Call (request, eventListener,sender); } } /// - /// Returns the current linked storage settings for an Application Insights component. + /// Actual wire call for method. /// - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// the prepared HttpRequestMessage to send. /// 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. + /// 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) + internal async global::System.Threading.Tasks.Task ComponentAvailableFeaturesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 + 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - 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) + 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 null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentAvailableFeatures.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the 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) + 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 ) { @@ -2581,6 +2935,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2588,14 +2943,12 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentAvailableFeatures.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; + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); } } } @@ -2610,47 +2963,42 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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) + internal async global::System.Threading.Tasks.Task ComponentAvailableFeaturesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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. + /// Returns current billing features for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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) + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesGet(string subscriptionId, string resourceGroupName, 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 = @"2020-03-01-preview"; - var storageType = @"ServiceProfiler"; + var apiVersion = @"2015-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2662,8 +3010,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/linkedStorageAccounts/" - + global::System.Uri.EscapeDataString(storageType) + + "/currentbillingfeatures" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2672,50 +3019,41 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + await this.ComponentCurrentBillingFeaturesGet_Call (request, onOk,eventListener,sender); } } - /// Update linked storage accounts for an Application Insights component. + /// Returns current billing features 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) + 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 = @"2020-03-01-preview"; + 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/(?[^/]+)/linkedStorageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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}/linkedStorageAccounts/{storageType}'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var storageType = _match.Groups["storageType"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2724,8 +3062,7 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/linkedStorageAccounts/" - + storageType + + "/currentbillingfeatures" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2734,111 +3071,78 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + 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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Returns current billing features for an Application Insights component. + /// /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesGetViaIdentityWithResult(global::System.String viaIdentity, 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 ) { - 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures'"); } - } - } - /// - /// Validation method for method. Call 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); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentCurrentBillingFeaturesGetWithResult_Call (request, eventListener,sender); } } - /// - /// Returns daily data volume cap (quota) status for an Application Insights component. - /// - /// The name of the resource group. The name is case insensitive. + /// Returns current billing features for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -2852,79 +3156,73 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/quotastatus" + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentQuotaStatusGet_Call(request,onOk,eventListener,sender); + return await this.ComponentCurrentBillingFeaturesGetWithResult_Call (request, eventListener,sender); } } /// - /// Returns daily data volume cap (quota) status for an Application Insights component. + /// Actual wire call for method. /// - /// - /// a delegate that is called when the remote service returns 200 (OK). + /// the prepared HttpRequestMessage to send. /// 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. + /// 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) + internal async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 + 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - 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) + 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 null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentBillingFeatures.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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. + /// 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. @@ -2932,7 +3230,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 ) { @@ -2943,6 +3241,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2950,7 +3249,7 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentBillingFeatures.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -2970,48 +3269,44 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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) + internal async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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. + /// update current billing features for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. - /// Properties that need to be specified to create 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). - /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-02-02"; + var apiVersion = @"2015-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3023,6 +3318,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) + + "/currentbillingfeatures" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3036,45 +3332,41 @@ public partial class ApplicationInsightsManagementClient 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 = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ComponentsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ComponentCurrentBillingFeaturesUpdate_Call (request, onOk,eventListener,sender); } } - /// - /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey - /// nor AppId in the Put operation. - /// + /// update current billing features for an Application Insights component. /// - /// Properties that need to be specified to create 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). - /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-02-02"; + 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); + 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}'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -3084,6 +3376,7 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName + + "/currentbillingfeatures" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3097,106 +3390,133 @@ public partial class ApplicationInsightsManagementClient 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 = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ComponentsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + 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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update current billing features for an Application Insights component. + /// + /// Properties that need to be specified to update billing features for an Application Insights component. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// 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) + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2015-05-01"; + // Constant Parameters 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentCurrentBillingFeaturesUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The name of the resource group. The name is case insensitive. + /// update current billing features for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. - /// Properties that need to be specified to create an Application Insights component. + /// Json string supplied to the ComponentCurrentBillingFeaturesUpdate operation + /// 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 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) + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, 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 ) { - 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); + // 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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentCurrentBillingFeaturesUpdate_Call (request, onOk,eventListener,sender); } } - /// Deletes an Application Insights component. - /// The name of the resource group. The name is case insensitive. + /// update current billing features for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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). + /// Json string supplied to the ComponentCurrentBillingFeaturesUpdate operation /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2020-02-02"; + var apiVersion = @"2015-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3208,89 +3528,135 @@ public partial class ApplicationInsightsManagementClient + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ComponentCurrentBillingFeaturesUpdateWithResult_Call (request, 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). + /// update current billing features for an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// 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) + public async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-02-02"; + 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}'"); - } - - // 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 + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" - + resourceName + + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ComponentCurrentBillingFeaturesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentCurrentBillingFeaturesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentBillingFeatures.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage 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) + 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 ) { @@ -3301,6 +3667,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3308,20 +3675,12 @@ public partial class ApplicationInsightsManagementClient 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); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentBillingFeatures.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; + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); } } } @@ -3336,44 +3695,45 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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 ComponentsDelete_Validate(string resourceGroupName, string subscriptionId, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ComponentCurrentBillingFeaturesUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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 an Application Insights component. - /// The name of the resource group. The name is case insensitive. + /// Returns feature capabilities of the application insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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) + public async global::System.Threading.Tasks.Task ComponentFeatureCapabilitiesGet(string subscriptionId, string resourceGroupName, 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 = @"2020-02-02"; + var apiVersion = @"2015-05-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3385,6 +3745,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) + + "/featurecapabilities" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3398,39 +3759,45 @@ public partial class ApplicationInsightsManagementClient 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); + await this.ComponentFeatureCapabilitiesGet_Call (request, onOk,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. + /// Returns feature capabilities of the 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 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) + 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 = @"2020-02-02"; + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/microsoft.insights/components/" - + global::System.Uri.EscapeDataString(resourceName) - + "/operations/" - + global::System.Uri.EscapeDataString(purgeId) + + resourceName + + "/featurecapabilities" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3444,39 +3811,36 @@ public partial class ApplicationInsightsManagementClient 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); + await this.ComponentFeatureCapabilitiesGet_Call (request, onOk,eventListener,sender); } } - /// Get status for an ongoing purge operation. + /// Returns feature capabilities of the 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentFeatureCapabilitiesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2020-02-02"; + 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/(?[^/]+)/operations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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}/operations/{purgeId}'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var purgeId = _match.Groups["purgeId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -3485,164 +3849,123 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/operations/" - + purgeId + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentsGetPurgeStatus_Call(request,onOk,onDefault,eventListener,sender); + return await this.ComponentFeatureCapabilitiesGetWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Returns feature capabilities of the application insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentFeatureCapabilitiesGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, 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 ) { - 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 + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" - + resourceName + + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.ComponentFeatureCapabilitiesGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentFeatureCapabilitiesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeatureCapabilities.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the 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) + 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 ) { @@ -3653,6 +3976,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3660,14 +3984,12 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeatureCapabilities.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; + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); } } } @@ -3682,42 +4004,48 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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) + internal async global::System.Threading.Tasks.Task ComponentFeatureCapabilitiesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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. + /// Replace current linked storage account for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-02-02"; + var storageType = @"ServiceProfiler"; + var apiVersion = @"2020-03-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3725,7 +4053,12 @@ public partial class ApplicationInsightsManagementClient var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/microsoft.insights/components" + + "/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"); @@ -3734,39 +4067,61 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ComponentsList_Call(request,onOk,onDefault,eventListener,sender); + await this.ComponentLinkedStorageAccountsCreateAndUpdate_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. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-02-02"; + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var storageType = _match.Groups["storageType"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/components" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + resourceName + + "/linkedStorageAccounts/" + + storageType + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3775,68 +4130,85 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ComponentsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.ComponentLinkedStorageAccountsCreateAndUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a list of Application Insights components within a resource group. + /// Replace current linked storage account 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). + /// Properties that need to be specified to update linked storage accounts for an Application Insights + /// component. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-02-02"; + 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$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].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" + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.ComponentLinkedStorageAccountsCreateAndUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// Replace current linked storage account for an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the ComponentLinkedStorageAccountsCreateAndUpdate 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). @@ -3845,116 +4217,209 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { + var storageType = @"ServiceProfiler"; + var apiVersion = @"2020-03-01-preview"; + // Constant Parameters 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; + // 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"); - 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(); - } + 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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsCreateAndUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The name of the resource group. The name is case insensitive. + /// Replace current linked storage account for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the ComponentLinkedStorageAccountsCreateAndUpdate operation /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { + var storageType = @"ServiceProfiler"; + var apiVersion = @"2020-03-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - 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); + // 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentLinkedStorageAccountsCreateAndUpdateWithResult_Call (request, eventListener,sender); } } - /// 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). + /// Replace current linked storage account for an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-02-02"; + var storageType = @"ServiceProfiler"; + 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/(?[^/]+)/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" + + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ComponentsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.ComponentLinkedStorageAccountsCreateAndUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentLinkedStorageAccountsCreateAndUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccounts.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3964,7 +4429,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 ) { @@ -3975,6 +4440,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3982,13 +4448,13 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.Api202002.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4004,38 +4470,39 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. /// /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the 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 ComponentsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsCreateAndUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// 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. - /// Note: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge - /// operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , - /// scoped to specific resource id. - /// - /// The name of the resource group. The name is case insensitive. + /// Delete linked storage accounts for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4043,9 +4510,10 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsDelete(string subscriptionId, string resourceGroupName, 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"; + var storageType = @"ServiceProfiler"; + var apiVersion = @"2020-03-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4057,7 +4525,8 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/purge" + + "/linkedStorageAccounts/" + + global::System.Uri.EscapeDataString(storageType) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4066,32 +4535,19 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + await this.ComponentLinkedStorageAccountsDelete_Call (request, onOk,onNoContent,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. - /// Note: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge - /// operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , - /// scoped to specific resource id. - /// + /// Delete linked storage accounts for an Application Insights component. /// - /// 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 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4099,24 +4555,25 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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-02-02"; + 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/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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}/purge'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; + var storageType = _match.Groups["storageType"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -4125,7 +4582,8 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/purge" + + "/linkedStorageAccounts/" + + storageType + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4134,22 +4592,21 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + await this.ComponentLinkedStorageAccountsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// 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 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4157,7 +4614,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 ) { @@ -4168,20 +4625,27 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.Accepted: + 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 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)) )); + 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)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4197,39 +4661,35 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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) + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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. + /// 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 resource group. The name is case insensitive. /// 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). @@ -4238,9 +4698,10 @@ public partial class ApplicationInsightsManagementClient /// /// 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.Api202002.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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsGet(string subscriptionId, string resourceGroupName, 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"; + var storageType = @"ServiceProfiler"; + var apiVersion = @"2020-03-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4252,6 +4713,8 @@ public partial class ApplicationInsightsManagementClient + 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"); @@ -4260,24 +4723,19 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + await this.ComponentLinkedStorageAccountsGet_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + /// Returns the current linked storage settings for an Application Insights component. /// /// - /// 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). @@ -4286,24 +4744,25 @@ public partial class ApplicationInsightsManagementClient /// /// 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.Api202002.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) + 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-02-02"; + 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/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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}'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; + var storageType = _match.Groups["storageType"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -4312,6 +4771,8 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName + + "/linkedStorageAccounts/" + + storageType + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4320,110 +4781,87 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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); + 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). + /// + /// Returns the current linked storage settings for an Application Insights component. + /// + /// /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsGetViaIdentityWithResult(global::System.String viaIdentity, 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 ) { - 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentLinkedStorageAccountsGetWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// 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. - /// 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.Api202002.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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2015-05-01"; + var storageType = @"ServiceProfiler"; + var apiVersion = @"2020-03-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4435,95 +4873,98 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/exportconfiguration" + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExportConfigurationsCreate_Call(request,onOk,eventListener,sender); + return await this.ComponentLinkedStorageAccountsGetWithResult_Call (request, 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// 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. + /// 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) + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 + 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - 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) + 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 null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccounts.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 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) + 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 ) { @@ -4534,6 +4975,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4541,12 +4983,14 @@ public partial class ApplicationInsightsManagementClient 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)); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccounts.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { - throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + 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.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } } } @@ -4561,47 +5005,48 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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) + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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. + /// update linked storage accounts for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2015-05-01"; + var storageType = @"ServiceProfiler"; + var apiVersion = @"2020-03-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4613,8 +5058,8 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/exportconfiguration/" - + global::System.Uri.EscapeDataString(exportId) + + "/linkedStorageAccounts/" + + global::System.Uri.EscapeDataString(storageType) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4623,42 +5068,51 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ExportConfigurationsDelete_Call(request,onOk,eventListener,sender); + await this.ComponentLinkedStorageAccountsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a Continuous Export configuration of an Application Insights component. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2015-05-01"; + 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/(?[^/]+)/exportconfiguration/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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}/exportconfiguration/{exportId}'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var exportId = _match.Groups["exportId"].Value; + var storageType = _match.Groups["storageType"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -4667,8 +5121,8 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/exportconfiguration/" - + exportId + + "/linkedStorageAccounts/" + + storageType + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4677,100 +5131,146 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ExportConfigurationsDelete_Call(request,onOk,eventListener,sender); + 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). + /// 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. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-03-01-preview"; + // Constant Parameters 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentLinkedStorageAccountsUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The name of the resource group. The name is case insensitive. + /// update linked storage accounts for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. - /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// Json string supplied to the ComponentLinkedStorageAccountsUpdate 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. /// - 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { + var storageType = @"ServiceProfiler"; + var apiVersion = @"2020-03-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - 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(exportId),exportId); + // 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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentLinkedStorageAccountsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the Continuous Export configuration for this export id. - /// The name of the resource group. The name is case insensitive. + /// update linked storage accounts for an Application Insights component. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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). + /// Json string supplied to the ComponentLinkedStorageAccountsUpdate operation /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2015-05-01"; + var storageType = @"ServiceProfiler"; + var apiVersion = @"2020-03-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4782,88 +5282,155 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/exportconfiguration/" - + global::System.Uri.EscapeDataString(exportId) + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExportConfigurationsGet_Call(request,onOk,eventListener,sender); + return await this.ComponentLinkedStorageAccountsUpdateWithResult_Call (request, eventListener,sender); } } - /// Get the Continuous Export configuration for this export id. - /// - /// a delegate that is called when the remote service returns 200 (OK). + /// update linked storage accounts for an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// 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) + public async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2015-05-01"; + var storageType = @"ServiceProfiler"; + 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/(?[^/]+)/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 + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" - + resourceName - + "/exportconfiguration/" - + exportId + + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExportConfigurationsGet_Call(request,onOk,eventListener,sender); + return await this.ComponentLinkedStorageAccountsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentLinkedStorageAccountsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccounts.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 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) + 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 ) { @@ -4874,6 +5441,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4881,12 +5449,14 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccounts.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { - throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + 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.ErrorResponseLinkedStorage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } } } @@ -4901,36 +5471,38 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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 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 ExportConfigurationsGet_Validate(string resourceGroupName, string subscriptionId, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ComponentLinkedStorageAccountsUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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); } } /// - /// Gets a list of Continuous Export configuration of an Application Insights component. + /// 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 resource group. The name is case insensitive. /// 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. @@ -4938,7 +5510,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + public async global::System.Threading.Tasks.Task ComponentQuotaStatusGet(string subscriptionId, string resourceGroupName, 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 @@ -4952,7 +5524,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/exportconfiguration" + + "/quotastatus" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4966,12 +5538,12 @@ public partial class ApplicationInsightsManagementClient 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); + await this.ComponentQuotaStatusGet_Call (request, onOk,eventListener,sender); } } /// - /// Gets a list of Continuous Export configuration of an Application Insights component. + /// Returns daily data volume cap (quota) status for an Application Insights component. /// /// /// a delegate that is called when the remote service returns 200 (OK). @@ -4980,7 +5552,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 @@ -4988,15 +5560,15 @@ public partial class ApplicationInsightsManagementClient { // 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); + 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}/exportconfiguration'"); + 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 resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -5006,7 +5578,7 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/components/" + resourceName - + "/exportconfiguration" + + "/quotastatus" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5020,92 +5592,77 @@ public partial class ApplicationInsightsManagementClient 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); + 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). + /// + /// Returns daily data volume cap (quota) status for an Application Insights component. + /// + /// /// 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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentQuotaStatusGetViaIdentityWithResult(global::System.String viaIdentity, 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 ) { - 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; + // verify that Identity format is an exact match for uri - 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 + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentQuotaStatusGetWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// 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. - /// an 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.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. + /// 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) + public async global::System.Threading.Tasks.Task ComponentQuotaStatusGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2015-05-01"; // Constant Parameters @@ -5119,89 +5676,71 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) - + "/exportconfiguration/" - + global::System.Uri.EscapeDataString(exportId) + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExportConfigurationsUpdate_Call(request,onOk,eventListener,sender); + return await this.ComponentQuotaStatusGetWithResult_Call (request, 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// 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. + /// 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) + internal async global::System.Threading.Tasks.Task ComponentQuotaStatusGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 + 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - 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) + 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 null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentQuotaStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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. + /// 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. @@ -5209,7 +5748,7 @@ public partial class ApplicationInsightsManagementClient /// /// 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) + 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 ) { @@ -5220,6 +5759,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5227,7 +5767,7 @@ public partial class ApplicationInsightsManagementClient 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)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentQuotaStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -5247,52 +5787,49 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// 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) + internal async global::System.Threading.Tasks.Task ComponentQuotaStatusGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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); } } - /// Create a new private workbook. + /// + /// update (or update an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// nor AppId in the Put operation. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. - /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new private workbook. + /// 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 201 (Created). /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ComponentsCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-03-08"; + var apiVersion = @"2020-02-02"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5302,11 +5839,9 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/myWorkbooks/" + + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) + "?" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5319,39 +5854,41 @@ public partial class ApplicationInsightsManagementClient 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 = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MyWorkbooksCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ComponentsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a new private workbook. + /// + /// update (or update an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// nor AppId in the Put operation. + /// /// - /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new private workbook. + /// 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 201 (Created). /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ComponentsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-03-08"; + 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/myWorkbooks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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/myWorkbooks/{resourceName}'"); + 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 @@ -5364,11 +5901,9 @@ public partial class ApplicationInsightsManagementClient + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/microsoft.insights/myWorkbooks/" + + "/providers/microsoft.insights/components/" + resourceName + "?" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5381,115 +5916,142 @@ public partial class ApplicationInsightsManagementClient 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 = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MyWorkbooksCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + 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 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// update (or update 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. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MyWorkbooksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ComponentsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-02-02"; + // Constant Parameters 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; + // verify that Identity format is an exact match for uri - 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.Api20210308.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbook.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.Api20210308.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + 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) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// update (or update an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// nor AppId in the Put operation. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. - /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new private workbook. + /// Json string supplied to the ComponentsCreateOrUpdate 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. /// - internal async global::System.Threading.Tasks.Task MyWorkbooksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ComponentsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { + var apiVersion = @"2020-02-02"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertNotNull(nameof(sourceId),sourceId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // 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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a private workbook. + /// + /// update (or update an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// nor AppId in the Put operation. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// 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). + /// Json string supplied to the ComponentsCreateOrUpdate operation /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksDelete(string subscriptionId, string resourceGroupName, 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) + public async global::System.Threading.Tasks.Task ComponentsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2021-03-08"; + var apiVersion = @"2020-02-02"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5499,83 +6061,142 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/myWorkbooks/" + + "/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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MyWorkbooksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ComponentsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Delete a private workbook. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// update (or update an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// nor AppId in the Put operation. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksDeleteViaIdentity(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) + public async global::System.Threading.Tasks.Task ComponentsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-03-08"; + 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/myWorkbooks/(?[^/]+)$", global::System.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/myWorkbooks/{resourceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/microsoft.insights/myWorkbooks/" - + resourceName + + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MyWorkbooksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ComponentsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponent.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage 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. @@ -5583,7 +6204,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MyWorkbooksDelete_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) + 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 ) { @@ -5594,6 +6215,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5601,19 +6223,13 @@ public partial class ApplicationInsightsManagementClient 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); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.Api20210308.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5629,17 +6245,18 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the 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 MyWorkbooksDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ComponentsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5649,14 +6266,17 @@ public partial class ApplicationInsightsManagementClient await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get a single private workbook by its resourceName. + /// Deletes an Application Insights component. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// 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. @@ -5664,9 +6284,9 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksGet(string subscriptionId, string resourceGroupName, 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) + public async global::System.Threading.Tasks.Task ComponentsDelete(string subscriptionId, string resourceGroupName, 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 = @"2021-03-08"; + var apiVersion = @"2020-02-02"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5676,7 +6296,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/myWorkbooks/" + + "/providers/microsoft.insights/components/" + global::System.Uri.EscapeDataString(resourceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) @@ -5686,18 +6306,19 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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.MyWorkbooksGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ComponentsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Get a single private workbook by its resourceName. + /// 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. @@ -5705,18 +6326,18 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksGetViaIdentity(global::System.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) + 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 = @"2021-03-08"; + 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/myWorkbooks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + 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/myWorkbooks/{resourceName}'"); + 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 @@ -5729,7 +6350,7 @@ public partial class ApplicationInsightsManagementClient + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/microsoft.insights/myWorkbooks/" + + "/providers/microsoft.insights/components/" + resourceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) @@ -5739,18 +6360,19 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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.MyWorkbooksGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ComponentsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage 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. @@ -5758,7 +6380,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MyWorkbooksGet_Call(global::System.Net.Http.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) + 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 ) { @@ -5769,6 +6391,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5776,13 +6399,19 @@ public partial class ApplicationInsightsManagementClient 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.Api20210308.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + 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.Api20210308.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5798,7 +6427,7 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. @@ -5808,7 +6437,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MyWorkbooksGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ComponentsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5821,16 +6450,10 @@ public partial class ApplicationInsightsManagementClient } } - /// - /// Get all private workbooks defined within a specified resource group and category. - /// + /// Returns an Application Insights component. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Category of workbook to return. - /// Tags presents on each workbook returned. - /// Azure Resource Id that will fetch all linked workbooks. - /// Flag indicating whether or not to return the full content for each applicable workbook. - /// If false, only return summary content for workbooks. + /// 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). @@ -5839,9 +6462,9 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksListByResourceGroup(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, string sourceId, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task ComponentsGet(string subscriptionId, string resourceGroupName, 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 = @"2021-03-08"; + var apiVersion = @"2020-02-02"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5851,16 +6474,9 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/myWorkbooks" + + "/providers/microsoft.insights/components/" + + global::System.Uri.EscapeDataString(resourceName) + "?" - + "category=" + global::System.Uri.EscapeDataString(category) - + "&" - + (null != tags && tags.Length > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) - + "&" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) - + "&" - + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5873,19 +6489,15 @@ public partial class ApplicationInsightsManagementClient await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MyWorkbooksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.ComponentsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Get all private workbooks defined within a specified resource group and category. - /// - /// - /// Category of workbook to return. - /// Tags presents on each workbook returned. - /// Azure Resource Id that will fetch all linked workbooks. - /// Flag indicating whether or not to return the full content for each applicable workbook. - /// If false, only return summary content for workbooks. + /// Get status for an ongoing purge operation. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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). @@ -5894,39 +6506,7464 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksListByResourceGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, string sourceId, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task ComponentsGetPurgeStatus(string subscriptionId, string resourceGroupName, 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 = @"2021-03-08"; + var apiVersion = @"2020-02-02"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - + // 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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); + } + } + + /// Get status for an ongoing purge operation. + /// + /// 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 ComponentsGetPurgeStatusViaIdentityWithResult(global::System.String viaIdentity, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsGetPurgeStatusWithResult_Call (request, eventListener,sender); + } + } + + /// Get status for an ongoing purge operation. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// 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 ComponentsGetPurgeStatusWithResult(string subscriptionId, string resourceGroupName, string resourceName, string purgeId, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsGetPurgeStatusWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentsGetPurgeStatusWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeStatusResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, string resourceName, string purgeId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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); + } + } + + /// Returns an Application Insights component. + /// + /// 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 ComponentsGetViaIdentityWithResult(global::System.String viaIdentity, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Returns an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// 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 ComponentsGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponent.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 subscriptionId, string resourceGroupName, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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); + } + } + + /// Gets a list of Application Insights components within a resource group. + /// + /// 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 ComponentsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Gets a list of Application Insights components within a resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 ComponentsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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. + /// The name of the resource group. The name is case insensitive. + /// an 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 subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + } + } + + /// 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); + } + } + + /// Gets a list of all Application Insights components within a subscription. + /// + /// 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 ComponentsListViaIdentityWithResult(global::System.String viaIdentity, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsListWithResult_Call (request, eventListener,sender); + } + } + + /// Gets a list of all Application Insights components within a subscription. + /// The ID of the target subscription. + /// 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 ComponentsListWithResult(string subscriptionId, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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. + /// Note: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge + /// operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , + /// scoped to specific resource id. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsPurge(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// Note: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge + /// operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , + /// scoped to specific resource id. + /// + /// + /// 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsPurgeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// Note: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge + /// operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , + /// scoped to specific resource id. + /// + /// + /// Describes the body of a request to purge data in a single table of an Application Insights component + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsPurgeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsPurgeWithResult_Call (request, 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. + /// Note: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge + /// operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , + /// scoped to specific resource id. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the ComponentsPurge operation + /// 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 ComponentsPurgeViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, 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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// Note: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge + /// operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , + /// scoped to specific resource id. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the ComponentsPurge operation + /// 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 ComponentsPurgeViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsPurgeWithResult_Call (request, 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. + /// Note: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge + /// operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , + /// scoped to specific resource id. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsPurgeWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsPurgeWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentsPurgeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.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.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.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. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// update an existing component's tags. To update other fields use the CreateOrupdate method. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsUpdateTags(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsUpdateTags_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsUpdateTagsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsUpdateTags_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update an existing component's tags. To update other fields use the CreateOrupdate method. + /// + /// + /// Updated tag information to set into the component instance. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsUpdateTagsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsUpdateTagsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update an existing component's tags. To update other fields use the CreateOrupdate method. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the ComponentsUpdateTags 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 ComponentsUpdateTagsViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ComponentsUpdateTags_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update an existing component's tags. To update other fields use the CreateOrupdate method. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the ComponentsUpdateTags operation + /// 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 ComponentsUpdateTagsViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsUpdateTagsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update an existing component's tags. To update other fields use the CreateOrupdate method. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Updated tag information to set into the component instance. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ComponentsUpdateTagsWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ComponentsUpdateTagsWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ComponentsUpdateTagsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponent.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponents.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsCreate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task> ExportConfigurationsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create a Continuous Export configuration of an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the ExportConfigurationsCreate operation + /// 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 ExportConfigurationsCreateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, 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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the ExportConfigurationsCreate operation + /// 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> ExportConfigurationsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create a Continuous Export configuration of an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task> ExportConfigurationsCreateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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> ExportConfigurationsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _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.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportConfiguration.FromJson(__x) )) ))() : null); + return await _result; + } + 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(); + } + } + } + + /// 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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); + } + } + + /// Delete a Continuous Export configuration of an Application Insights component. + /// + /// 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 ExportConfigurationsDeleteViaIdentityWithResult(global::System.String viaIdentity, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsDeleteWithResult_Call (request, eventListener,sender); + } + } + + /// Delete a Continuous Export configuration of an Application Insights component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// 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 ExportConfigurationsDeleteWithResult(string subscriptionId, string resourceGroupName, string resourceName, string exportId, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsDeleteWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ExportConfigurationsDeleteWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } + } + } + + /// 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(exportId),exportId); + } + } + + /// Get the Continuous Export configuration for this export id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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); + } + } + + /// Get the Continuous Export configuration for this export id. + /// + /// 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 ExportConfigurationsGetViaIdentityWithResult(global::System.String viaIdentity, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the Continuous Export configuration for this export id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// 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 ExportConfigurationsGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, string exportId, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ExportConfigurationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } + } + } + + /// 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(exportId),exportId); + } + } + + /// + /// Gets a list of Continuous Export configuration of an Application Insights component. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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); + } + } + + /// + /// Gets a list of Continuous Export configuration of an Application Insights component. + /// + /// + /// 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> ExportConfigurationsListViaIdentityWithResult(global::System.String viaIdentity, 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Gets a list of Continuous Export configuration of an Application Insights component. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// 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> ExportConfigurationsListWithResult(string subscriptionId, string resourceGroupName, string resourceName, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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> ExportConfigurationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _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.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportConfiguration.FromJson(__x) )) ))() : null); + return await _result; + } + 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(); + } + } + } + + /// 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// update the Continuous Export configuration for this export id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsUpdate(string subscriptionId, string resourceGroupName, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the Continuous Export configuration for this export id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// Json string supplied to the ExportConfigurationsUpdate operation + /// 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 ExportConfigurationsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string exportId, global::System.String jsonString, 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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// The Continuous Export configuration ID. This is unique within a Application Insights component. + /// Json string supplied to the ExportConfigurationsUpdate operation + /// 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 ExportConfigurationsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string exportId, global::System.String jsonString, 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the Continuous Export configuration for this export id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExportConfigurationsUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExportConfigurationsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 ExportConfigurationsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } + } + } + + /// 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 subscriptionId, string resourceGroupName, string resourceName, string exportId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(exportId),exportId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// update a new private workbook. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MyWorkbooksCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MyWorkbooksCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update a new private workbook. + /// + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MyWorkbooksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + 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/myWorkbooks/(?[^/]+)$", global::System.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/myWorkbooks/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/myWorkbooks/" + + resourceName + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MyWorkbooksCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update a new private workbook. + /// + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MyWorkbooksCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + 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/myWorkbooks/(?[^/]+)$", global::System.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/myWorkbooks/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/myWorkbooks/" + + resourceName + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a new private workbook. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Json string supplied to the MyWorkbooksCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, 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 = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MyWorkbooksCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update a new private workbook. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Json string supplied to the MyWorkbooksCreateOrUpdate operation + /// 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 MyWorkbooksCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a new private workbook. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MyWorkbooksCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the 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 MyWorkbooksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.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.MyWorkbookError.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. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MyWorkbooksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(sourceId),sourceId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete a private workbook. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 MyWorkbooksDelete(string subscriptionId, string resourceGroupName, 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 = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + 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.MyWorkbooksDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a private workbook. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the 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 MyWorkbooksDeleteViaIdentity(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 = @"2021-03-08"; + // Constant Parameters + 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/myWorkbooks/(?[^/]+)$", global::System.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/myWorkbooks/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/myWorkbooks/" + + 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.MyWorkbooksDelete_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 MyWorkbooksDelete_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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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.MyWorkbookError.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. + /// The name of the resource group. The name is case insensitive. + /// 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 MyWorkbooksDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// Get a single private workbook by its resourceName. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 MyWorkbooksGet(string subscriptionId, string resourceGroupName, 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 = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + 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.MyWorkbooksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a single private workbook by its resourceName. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 MyWorkbooksGetViaIdentity(global::System.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 = @"2021-03-08"; + // Constant Parameters + 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/myWorkbooks/(?[^/]+)$", global::System.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/myWorkbooks/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/myWorkbooks/" + + 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.MyWorkbooksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a single private workbook by its resourceName. + /// + /// 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 MyWorkbooksGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + 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/myWorkbooks/(?[^/]+)$", global::System.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/myWorkbooks/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/myWorkbooks/" + + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a single private workbook by its resourceName. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// 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 MyWorkbooksGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksGet_Call(global::System.Net.Http.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.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.MyWorkbookError.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. + /// The name of the resource group. The name is case insensitive. + /// 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 MyWorkbooksGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + } + } + + /// + /// Get all private workbooks defined within a specified resource group and category. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 MyWorkbooksListByResourceGroup(string subscriptionId, string resourceGroupName, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, 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 = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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.MyWorkbooksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get all private workbooks defined within a specified resource group and category. + /// + /// + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 MyWorkbooksListByResourceGroupViaIdentity(global::System.String viaIdentity, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, 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 = @"2021-03-08"; + // Constant Parameters + 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/myWorkbooks$", global::System.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/myWorkbooks'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/myWorkbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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.MyWorkbooksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get all private workbooks defined within a specified resource group and category. + /// + /// + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// 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 MyWorkbooksListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + 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/myWorkbooks$", global::System.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/myWorkbooks'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/myWorkbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Get all private workbooks defined within a specified resource group and category. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// 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 MyWorkbooksListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbooksListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksListByResourceGroup_Call(global::System.Net.Http.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbooksListResult.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.MyWorkbookError.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. + /// The name of the resource group. The name is case insensitive. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MyWorkbooksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(category),category); + await eventListener.AssertNotNull(nameof(sourceId),sourceId); + } + } + + /// Get all private workbooks defined within a specified subscription and category. + /// The ID of the target subscription. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 MyWorkbooksListBySubscription(string subscriptionId, string category, System.Collections.Generic.List tags, bool? canFetchContent, 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 = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/microsoft.insights/myWorkbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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.MyWorkbooksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get all private workbooks defined within a specified subscription and category. + /// + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 MyWorkbooksListBySubscriptionViaIdentity(global::System.String viaIdentity, string category, System.Collections.Generic.List tags, bool? canFetchContent, 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 = @"2021-03-08"; + // 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/myWorkbooks$", 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/myWorkbooks'"); + } + + // 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/myWorkbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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.MyWorkbooksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get all private workbooks defined within a specified subscription and category. + /// + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// 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 MyWorkbooksListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, string category, System.Collections.Generic.List tags, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // 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/myWorkbooks$", 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/myWorkbooks'"); + } + + // 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/myWorkbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get all private workbooks defined within a specified subscription and category. + /// The ID of the target subscription. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// 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 MyWorkbooksListBySubscriptionWithResult(string subscriptionId, string category, System.Collections.Generic.List tags, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/microsoft.insights/myWorkbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbooksListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksListBySubscription_Call(global::System.Net.Http.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbooksListResult.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.MyWorkbookError.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. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MyWorkbooksListBySubscription_Validate(string subscriptionId, string category, System.Collections.Generic.List tags, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(category),category); + } + } + + /// Updates a private workbook that has already been added. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MyWorkbooksUpdate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MyWorkbooksUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Updates a private workbook that has already been added. + /// + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MyWorkbooksUpdateViaIdentity(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + 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/myWorkbooks/(?[^/]+)$", global::System.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/myWorkbooks/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/myWorkbooks/" + + resourceName + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MyWorkbooksUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Updates a private workbook that has already been added. + /// + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MyWorkbooksUpdateViaIdentityWithResult(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + 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/myWorkbooks/(?[^/]+)$", global::System.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/myWorkbooks/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/myWorkbooks/" + + resourceName + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Updates a private workbook that has already been added. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Json string supplied to the MyWorkbooksUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, 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 = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MyWorkbooksUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Updates a private workbook that has already been added. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Json string supplied to the MyWorkbooksUpdate operation + /// 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 MyWorkbooksUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Updates a private workbook that has already been added. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MyWorkbooksUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-03-08"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/myWorkbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MyWorkbooksUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the 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 MyWorkbooksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.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.MyWorkbookError.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. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new private workbook. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MyWorkbooksUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(sourceId),sourceId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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 OperationsList(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 = @"2021-03-08"; + // 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.OperationsList_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 OperationsListViaIdentity(global::System.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 = @"2021-03-08"; + // 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.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists all of the available insights REST API operations. + /// + /// 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 OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all of the available insights REST API operations. + /// 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 OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-03-08"; + // 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 OperationsList_Call(global::System.Net.Http.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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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 OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// update an Application Insights web test definition. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest resource. + /// Properties that need to be specified to create or update an Application Insights web test definition. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WebTestsCreateOrUpdate(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest 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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/webtests/" + + global::System.Uri.EscapeDataString(webTestName) + + "?" + + "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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WebTestsCreateOrUpdate_Call (request, onOk,eventListener,sender); + } + } + + /// update an Application Insights web test definition. + /// + /// Properties that need to be specified to create or update an Application Insights web test definition. + /// 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. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WebTestsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest 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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + 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/webtests/(?[^/]+)$", global::System.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/webtests/{webTestName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var webTestName = _match.Groups["webTestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/webtests/" + + webTestName + + "?" + + "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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WebTestsCreateOrUpdate_Call (request, onOk,eventListener,sender); + } + } + + /// update an Application Insights web test definition. + /// + /// Properties that need to be specified to create or update an Application Insights web test definition. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WebTestsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + 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/webtests/(?[^/]+)$", global::System.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/webtests/{webTestName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var webTestName = _match.Groups["webTestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/webtests/" + + webTestName + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WebTestsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update an Application Insights web test definition. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest resource. + /// Json string supplied to the WebTestsCreateOrUpdate operation + /// 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 WebTestsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string webTestName, global::System.String jsonString, 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 = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/webtests/" + + global::System.Uri.EscapeDataString(webTestName) + + "?" + + "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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WebTestsCreateOrUpdate_Call (request, onOk,eventListener,sender); + } + } + + /// update an Application Insights web test definition. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest resource. + /// Json string supplied to the WebTestsCreateOrUpdate operation + /// 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 WebTestsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string webTestName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/webtests/" + + global::System.Uri.EscapeDataString(webTestName) + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WebTestsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update an Application Insights web test definition. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest resource. + /// Properties that need to be specified to create or update an Application Insights web test definition. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WebTestsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/webtests/" + + global::System.Uri.EscapeDataString(webTestName) + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WebTestsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WebTestsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } + } + } + + /// 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 WebTestsCreateOrUpdate_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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTest.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest resource. + /// Properties that need to be specified to create or update an Application Insights web test definition. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task WebTestsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(webTestName),webTestName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes an Application Insights web test. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest 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). + /// 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 WebTestsDelete(string subscriptionId, string resourceGroupName, string webTestName, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/webtests/" + + global::System.Uri.EscapeDataString(webTestName) + + "?" + + "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.WebTestsDelete_Call (request, onOk,onNoContent,eventListener,sender); + } + } + + /// Deletes an Application Insights web test. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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 WebTestsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + 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/webtests/(?[^/]+)$", global::System.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/webtests/{webTestName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var webTestName = _match.Groups["webTestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/webtests/" + + webTestName + + "?" + + "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.WebTestsDelete_Call (request, onOk,onNoContent,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage 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). + /// 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 WebTestsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.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: + { + 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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest 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 WebTestsDelete_Validate(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(webTestName),webTestName); + } + } + + /// Get a specific Application Insights web test definition. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest 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 WebTestsGet(string subscriptionId, string resourceGroupName, string webTestName, 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 = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/webtests/" + + global::System.Uri.EscapeDataString(webTestName) + + "?" + + "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.WebTestsGet_Call (request, onOk,eventListener,sender); + } + } + + /// Get a specific Application Insights web test definition. + /// + /// 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 WebTestsGetViaIdentity(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 = @"2022-06-15"; + // Constant Parameters + 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/webtests/(?[^/]+)$", global::System.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/webtests/{webTestName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var webTestName = _match.Groups["webTestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/webtests/" + + webTestName + + "?" + + "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.WebTestsGet_Call (request, onOk,eventListener,sender); + } + } + + /// Get a specific Application Insights web test definition. + /// + /// 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 WebTestsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + 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/webtests/(?[^/]+)$", global::System.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/webtests/{webTestName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var webTestName = _match.Groups["webTestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/webtests/" + + webTestName + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WebTestsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a specific Application Insights web test definition. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest resource. + /// 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 WebTestsGetWithResult(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/webtests/" + + global::System.Uri.EscapeDataString(webTestName) + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WebTestsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WebTestsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } + } + } + + /// 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 WebTestsGet_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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTest.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest 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 WebTestsGet_Validate(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(webTestName),webTestName); + } + } + + /// + /// Get all Application Insights web test definitions for the specified subscription. + /// + /// The ID of the target subscription. + /// 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 WebTestsList(string subscriptionId, 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 = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/microsoft.insights/webtests" + + "?" + + "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.WebTestsList_Call (request, onOk,eventListener,sender); + } + } + + /// Get all Application Insights web tests defined for the specified component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 WebTestsListByComponent(string subscriptionId, string resourceGroupName, string componentName, 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 = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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(componentName) + + "/webtests" + + "?" + + "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.WebTestsListByComponent_Call (request, onOk,eventListener,sender); + } + } + + /// Get all Application Insights web tests defined for the specified 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 WebTestsListByComponentViaIdentity(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 = @"2022-06-15"; + // Constant Parameters + 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/(?[^/]+)/webtests$", global::System.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/{componentName}/webtests'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var componentName = _match.Groups["componentName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/microsoft.insights/myWorkbooks" + + "/providers/microsoft.insights/components/" + + componentName + + "/webtests" + "?" - + "category=" + global::System.Uri.EscapeDataString(category) - + "&" - + (null != tags && tags.Length > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) - + "&" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) - + "&" - + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5937,23 +13974,161 @@ public partial class ApplicationInsightsManagementClient 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.MyWorkbooksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WebTestsListByComponent_Call (request, onOk,eventListener,sender); + } + } + + /// Get all Application Insights web tests defined for the specified component. + /// + /// 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 WebTestsListByComponentViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + 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/(?[^/]+)/webtests$", global::System.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/{componentName}/webtests'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var componentName = _match.Groups["componentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/components/" + + componentName + + "/webtests" + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WebTestsListByComponentWithResult_Call (request, eventListener,sender); + } + } + + /// Get all Application Insights web tests defined for the specified component. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// 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 WebTestsListByComponentWithResult(string subscriptionId, string resourceGroupName, string componentName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-06-15"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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(componentName) + + "/webtests" + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WebTestsListByComponentWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WebTestsListByComponentWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the 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 MyWorkbooksListByResourceGroup_Call(global::System.Net.Http.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) + internal async global::System.Threading.Tasks.Task WebTestsListByComponent_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 ) { @@ -5964,6 +14139,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5971,14 +14147,12 @@ public partial class ApplicationInsightsManagementClient 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.Api20210308.MyWorkbooksListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestListResult.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.Api20210308.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); } } } @@ -5993,21 +14167,17 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Category of workbook to return. - /// Tags presents on each workbook returned. - /// Azure Resource Id that will fetch all linked workbooks. - /// Flag indicating whether or not to return the full content for each applicable workbook. - /// If false, only return summary content for workbooks. + /// 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 MyWorkbooksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, string sourceId, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WebTestsListByComponent_Validate(string subscriptionId, string resourceGroupName, string componentName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6016,29 +14186,24 @@ public partial class ApplicationInsightsManagementClient await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(category),category); - await eventListener.AssertEnum(nameof(category),category,@"workbook", @"TSG", @"performance", @"retention"); - await eventListener.AssertNotNull(nameof(sourceId),sourceId); + await eventListener.AssertNotNull(nameof(componentName),componentName); } } - /// Get all private workbooks defined within a specified subscription and category. + /// + /// Get all Application Insights web tests defined for the specified resource group. + /// /// The ID of the target subscription. - /// Category of workbook to return. - /// Tags presents on each workbook returned. - /// Flag indicating whether or not to return the full content for each applicable workbook. - /// If false, only return summary content for workbooks. + /// The name of the resource group. The name is case insensitive. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the 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 MyWorkbooksListBySubscription(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task WebTestsListByResourceGroup(string subscriptionId, string resourceGroupName, 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 = @"2021-03-08"; + var apiVersion = @"2022-06-15"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6046,14 +14211,10 @@ public partial class ApplicationInsightsManagementClient var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/microsoft.insights/myWorkbooks" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/webtests" + "?" - + "category=" + global::System.Uri.EscapeDataString(category) - + "&" - + (null != tags && tags.Length > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) - + "&" - + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6066,52 +14227,45 @@ public partial class ApplicationInsightsManagementClient await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MyWorkbooksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.WebTestsListByResourceGroup_Call (request, onOk,eventListener,sender); } } - /// Get all private workbooks defined within a specified subscription and category. + /// + /// Get all Application Insights web tests defined for the specified resource group. + /// /// - /// Category of workbook to return. - /// Tags presents on each workbook returned. - /// Flag indicating whether or not to return the full content for each applicable workbook. - /// If false, only return summary content for workbooks. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the 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 MyWorkbooksListBySubscriptionViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task WebTestsListByResourceGroupViaIdentity(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 = @"2021-03-08"; + var apiVersion = @"2022-06-15"; // 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/myWorkbooks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/webtests$", 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/myWorkbooks'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/microsoft.insights/myWorkbooks" + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/webtests" + "?" - + "category=" + global::System.Uri.EscapeDataString(category) - + "&" - + (null != tags && tags.Length > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) - + "&" - + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6124,101 +14278,75 @@ public partial class ApplicationInsightsManagementClient await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MyWorkbooksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.WebTestsListByResourceGroup_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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Get all Application Insights web tests defined for the specified resource group. + /// + /// /// 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. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MyWorkbooksListBySubscription_Call(global::System.Net.Http.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) + public async global::System.Threading.Tasks.Task WebTestsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { + var apiVersion = @"2022-06-15"; + // Constant Parameters 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; + // verify that Identity format is an exact match for uri - 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.Api20210308.MyWorkbooksListResult.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.Api20210308.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/webtests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/webtests" + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WebTestsListByResourceGroupWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Get all Application Insights web tests defined for the specified resource group. /// /// The ID of the target subscription. - /// Category of workbook to return. - /// Tags presents on each workbook returned. - /// Flag indicating whether or not to return the full content for each applicable workbook. - /// If false, only return summary content for workbooks. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task MyWorkbooksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(category),category); - await eventListener.AssertEnum(nameof(category),category,@"workbook", @"TSG", @"performance", @"retention"); - } - } - - /// Updates a private workbook that has already been added. - /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Application Insights component resource. - /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new private workbook. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksUpdate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WebTestsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2021-03-08"; + var apiVersion = @"2022-06-15"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6228,105 +14356,81 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/myWorkbooks/" - + global::System.Uri.EscapeDataString(resourceName) + + "/providers/microsoft.insights/webtests" + "?" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) - + "&" + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MyWorkbooksUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + return await this.WebTestsListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// Updates a private workbook that has already been added. - /// - /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new private workbook. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MyWorkbooksUpdateViaIdentity(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-03-08"; - // Constant Parameters - 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/myWorkbooks/(?[^/]+)$", global::System.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/myWorkbooks/{resourceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/microsoft.insights/myWorkbooks/" - + resourceName - + "?" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) - + "&" - + "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; } + internal async global::System.Threading.Tasks.Task WebTestsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - 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.MyWorkbooksUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + 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 null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 MyWorkbooksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WebTestsListByResourceGroup_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 ) { @@ -6337,6 +14441,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6344,20 +14449,12 @@ public partial class ApplicationInsightsManagementClient 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.Api20210308.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestListResult.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.Api20210308.MyWorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); } } } @@ -6372,19 +14469,16 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Application Insights component resource. - /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new private workbook. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MyWorkbooksUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WebTestsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6393,31 +14487,40 @@ public partial class ApplicationInsightsManagementClient await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertNotNull(nameof(sourceId),sourceId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Lists all of the available insights REST API operations. + /// + /// Get all Application Insights web test definitions for the specified 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 OperationsList(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) + public async global::System.Threading.Tasks.Task WebTestsListViaIdentity(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 = @"2021-03-08"; + var apiVersion = @"2022-06-15"; // 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/webtests$", 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/webtests'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/microsoft.insights/operations" + "/subscriptions/" + + subscriptionId + + "/providers/microsoft.insights/webtests" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6431,132 +14534,69 @@ public partial class ApplicationInsightsManagementClient await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.WebTestsList_Call (request, onOk,eventListener,sender); } } - /// Lists all of the available insights REST API operations. + /// + /// Get all Application Insights web test definitions for the specified 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.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) + public async global::System.Threading.Tasks.Task WebTestsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2021-03-08"; + var apiVersion = @"2022-06-15"; // 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); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/microsoft.insights/webtests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/microsoft.insights/operations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/microsoft.insights/webtests'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/microsoft.insights/operations" + "/subscriptions/" + + subscriptionId + + "/providers/microsoft.insights/webtests" + "?" + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the 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 OperationsList_Call(global::System.Net.Http.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.Api20210308.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.Api20210308.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(); - } + return await this.WebTestsListWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Get all Application Insights web test definitions for the specified subscription. /// - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - - } - } - - /// Creates or updates an Application Insights web test definition. - /// The name of the resource group. The name is case insensitive. /// The ID of the target subscription. - /// The name of the Application Insights WebTest resource. - /// Properties that need to be specified to create or update an Application Insights web test definition. - /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsCreateOrUpdate(string resourceGroupName, string subscriptionId, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest 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) + public async global::System.Threading.Tasks.Task WebTestsListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15"; // Constant Parameters @@ -6566,88 +14606,71 @@ public partial class ApplicationInsightsManagementClient var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/webtests/" - + global::System.Uri.EscapeDataString(webTestName) + + "/providers/microsoft.insights/webtests" + "?" + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WebTestsCreateOrUpdate_Call(request,onOk,eventListener,sender); + return await this.WebTestsListWithResult_Call (request, eventListener,sender); } } - /// Creates or updates an Application Insights web test definition. - /// - /// Properties that need to be specified to create or update an Application Insights web test definition. - /// a delegate that is called when the remote service returns 200 (OK). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest 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) + internal async global::System.Threading.Tasks.Task WebTestsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2022-06-15"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/webtests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + 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 null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var webTestName = _match.Groups["webTestName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/microsoft.insights/webtests/" - + webTestName - + "?" - + "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.WebTestsCreateOrUpdate_Call(request,onOk,eventListener,sender); } } - /// Actual wire call for method. + /// 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. @@ -6655,7 +14678,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WebTestsCreateOrUpdate_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) + internal async global::System.Threading.Tasks.Task WebTestsList_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 ) { @@ -6666,6 +14689,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6673,7 +14697,7 @@ public partial class ApplicationInsightsManagementClient 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.Api20220615.WebTest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -6693,44 +14717,36 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call 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 WebTest resource. - /// Properties that need to be specified to create or update an Application Insights web test definition. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WebTestsCreateOrUpdate_Validate(string resourceGroupName, string subscriptionId, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WebTestsList_Validate(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); - await eventListener.AssertNotNull(nameof(webTestName),webTestName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Deletes an Application Insights web test. + /// update the tags associated with an Application Insights web test. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights WebTest resource. + /// Updated tag information to associate with the web test 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). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsDelete(string subscriptionId, string resourceGroupName, string webTestName, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WebTestsUpdateTags(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource 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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15"; // Constant Parameters @@ -6752,25 +14768,30 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WebTestsDelete_Call(request,onOk,onNoContent,eventListener,sender); + await this.WebTestsUpdateTags_Call (request, onOk,eventListener,sender); } } - /// Deletes an Application Insights web test. + /// update the tags associated with an Application Insights web test. /// + /// Updated tag information to associate with the web test 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). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WebTestsUpdateTagsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource 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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15"; // Constant Parameters @@ -6804,102 +14825,134 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WebTestsDelete_Call(request,onOk,onNoContent,eventListener,sender); + await this.WebTestsUpdateTags_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). - /// a delegate that is called when the remote service returns 204 (NoContent). + /// update the tags associated with an Application Insights web test. + /// + /// Updated tag information to associate with the web test resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WebTestsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WebTestsUpdateTagsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-06-15"; + // Constant Parameters 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; + // verify that Identity format is an exact match for uri - 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: - { - throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/webtests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var webTestName = _match.Groups["webTestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/webtests/" + + webTestName + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WebTestsUpdateTagsWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// update the tags associated with an Application Insights web test. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights WebTest resource. + /// Json string supplied to the WebTestsUpdateTags operation + /// 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 WebTestsDelete_Validate(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task WebTestsUpdateTagsViaJsonString(string subscriptionId, string resourceGroupName, string webTestName, global::System.String jsonString, 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 = @"2022-06-15"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(webTestName),webTestName); + // 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/webtests/" + + global::System.Uri.EscapeDataString(webTestName) + + "?" + + "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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WebTestsUpdateTags_Call (request, onOk,eventListener,sender); } } - /// Get a specific Application Insights web test definition. - /// The name of the resource group. The name is case insensitive. + /// update the tags associated with an Application Insights web test. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights WebTest resource. - /// a delegate that is called when the remote service returns 200 (OK). + /// Json string supplied to the WebTestsUpdateTags operation /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsGet(string resourceGroupName, string subscriptionId, string webTestName, 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) + public async global::System.Threading.Tasks.Task WebTestsUpdateTagsViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string webTestName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2022-06-15"; // Constant Parameters @@ -6917,71 +14970,117 @@ public partial class ApplicationInsightsManagementClient + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WebTestsGet_Call(request,onOk,eventListener,sender); + return await this.WebTestsUpdateTagsWithResult_Call (request, eventListener,sender); } } - /// Get a specific Application Insights web test definition. - /// - /// a delegate that is called when the remote service returns 200 (OK). + /// update the tags associated with an Application Insights web test. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights WebTest resource. + /// Updated tag information to associate with the web test resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsGetViaIdentity(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) + public async global::System.Threading.Tasks.Task WebTestsUpdateTagsWithResult(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-06-15"; // Constant Parameters 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/webtests/(?[^/]+)$", global::System.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/webtests/{webTestName}'"); - } - - // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var webTestName = _match.Groups["webTestName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/webtests/" - + webTestName + + global::System.Uri.EscapeDataString(webTestName) + "?" + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WebTestsGet_Call(request,onOk,eventListener,sender); + return await this.WebTestsUpdateTagsWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WebTestsUpdateTagsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + 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(); + } } } - /// Actual wire call for method. + /// 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. @@ -6989,7 +15088,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WebTestsGet_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) + internal async global::System.Threading.Tasks.Task WebTestsUpdateTags_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 ) { @@ -7000,6 +15099,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7007,7 +15107,7 @@ public partial class ApplicationInsightsManagementClient 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.Api20220615.WebTest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -7027,80 +15127,50 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Validation method for method. Call 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 resource group. The name is case insensitive. /// The name of the Application Insights WebTest resource. + /// Updated tag information to associate with the web test 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 WebTestsGet_Validate(string resourceGroupName, string subscriptionId, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WebTestsUpdateTags_Validate(string subscriptionId, string resourceGroupName, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(webTestName),webTestName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Get all Application Insights web test definitions for the specified subscription. - /// + /// update a new workbook template. /// The ID of the target subscription. - /// 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 WebTestsList(string subscriptionId, 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 = @"2022-06-15"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/microsoft.insights/webtests" - + "?" - + "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.WebTestsList_Call(request,onOk,eventListener,sender); - } - } - - /// Get all Application Insights web tests defined for the specified component. - /// The name of the Application Insights component resource. /// 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 new workbook. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsListByComponent(string componentName, string resourceGroupName, string subscriptionId, 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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2022-06-15"; + var apiVersion = @"2020-11-20"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7110,9 +15180,8 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/components/" - + global::System.Uri.EscapeDataString(componentName) - + "/webtests" + + "/providers/microsoft.insights/workbooktemplates/" + + global::System.Uri.EscapeDataString(resourceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7121,50 +15190,58 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WebTestsListByComponent_Call(request,onOk,eventListener,sender); + await this.WorkbookTemplatesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Get all Application Insights web tests defined for the specified component. + /// update a new workbook template. /// + /// Properties that need to be specified to create a new workbook. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsListByComponentViaIdentity(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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2022-06-15"; + var apiVersion = @"2020-11-20"; // Constant Parameters 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/(?[^/]+)/webtests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooktemplates/(?[^/]+)$", global::System.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/{componentName}/webtests'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'"); } // replace URI parameters with values from identity - var componentName = _match.Groups["componentName"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].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/" - + componentName - + "/webtests" + + "/providers/microsoft.insights/workbooktemplates/" + + resourceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7173,98 +15250,139 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WebTestsListByComponent_Call(request,onOk,eventListener,sender); + await this.WorkbookTemplatesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). + /// update a new workbook template. + /// + /// Properties that need to be specified to create a new workbook. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WebTestsListByComponent_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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-11-20"; + // Constant Parameters 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; + // verify that Identity format is an exact match for uri - 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.Api20220615.WebTestListResult.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 + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooktemplates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooktemplates/" + + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbookTemplatesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The name of the Application Insights component resource. - /// The name of the resource group. The name is case insensitive. + /// update a new workbook template. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the WorkbookTemplatesCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WebTestsListByComponent_Validate(string componentName, string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, 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-11-20"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(componentName),componentName); - 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); + // 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/workbooktemplates/" + + 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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkbookTemplatesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// - /// Get all Application Insights web tests defined for the specified resource group. - /// - /// The name of the resource group. The name is case insensitive. + /// update a new workbook template. /// The ID of the target subscription. - /// a delegate that is called when the remote service returns 200 (OK). + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the WorkbookTemplatesCreateOrUpdate operation /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsListByResourceGroup(string resourceGroupName, string subscriptionId, 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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2022-06-15"; + var apiVersion = @"2020-11-20"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7274,84 +15392,156 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/webtests" + + "/providers/microsoft.insights/workbooktemplates/" + + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WebTestsListByResourceGroup_Call(request,onOk,eventListener,sender); + return await this.WorkbookTemplatesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Get all Application Insights web tests defined for the specified resource group. - /// - /// - /// a delegate that is called when the remote service returns 200 (OK). + /// update a new workbook template. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create a new workbook. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WebTestsListByResourceGroupViaIdentity(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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2022-06-15"; + var apiVersion = @"2020-11-20"; // Constant Parameters 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/webtests$", global::System.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/webtests'"); - } - - // 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 + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/microsoft.insights/webtests" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/workbooktemplates/" + + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WebTestsListByResourceGroup_Call(request,onOk,eventListener,sender); + return await this.WorkbookTemplatesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbookTemplatesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WebTestsListByResourceGroup_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) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7362,6 +15552,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7369,12 +15560,20 @@ public partial class ApplicationInsightsManagementClient 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.Api20220615.WebTestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { - throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + 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.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } } } @@ -7389,58 +15588,113 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call 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 resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to create a new workbook. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WebTestsListByResourceGroup_Validate(string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(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); } } - /// - /// Get all Application Insights web test definitions for the specified subscription. - /// + /// Delete a workbook template. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 WorkbookTemplatesDelete(string subscriptionId, string resourceGroupName, 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-11-20"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/workbooktemplates/" + + 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.WorkbookTemplatesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a workbook template. /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the 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 WebTestsListViaIdentity(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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesDeleteViaIdentity(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 = @"2022-06-15"; + var apiVersion = @"2020-11-20"; // 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/webtests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooktemplates/(?[^/]+)$", 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/webtests'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/microsoft.insights/webtests" + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooktemplates/" + + resourceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7449,24 +15703,27 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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.WebTestsList_Call(request,onOk,eventListener,sender); + await this.WorkbookTemplatesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage 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 WebTestsList_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) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesDelete_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 ) { @@ -7477,6 +15734,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7484,12 +15742,20 @@ public partial class ApplicationInsightsManagementClient 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.Api20220615.WebTestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + 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: { - throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + 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.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } } } @@ -7504,37 +15770,44 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the 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 WebTestsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); } } - /// Updates the tags associated with an Application Insights web test. - /// The name of the resource group. The name is case insensitive. + /// Get a single workbook template by its resourceName. /// The ID of the target subscription. - /// The name of the Application Insights WebTest resource. - /// Updated tag information to associate with the web test resource. + /// The name of the resource group. The name is case insensitive. + /// 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 WebTestsUpdateTags(string resourceGroupName, string subscriptionId, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource 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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesGet(string subscriptionId, string resourceGroupName, 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 = @"2022-06-15"; + var apiVersion = @"2020-11-20"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7544,8 +15817,8 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/webtests/" - + global::System.Uri.EscapeDataString(webTestName) + + "/providers/microsoft.insights/workbooktemplates/" + + global::System.Uri.EscapeDataString(resourceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7554,54 +15827,51 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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.WebTestsUpdateTags_Call(request,onOk,eventListener,sender); + await this.WorkbookTemplatesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Updates the tags associated with an Application Insights web test. + /// Get a single workbook template by its resourceName. /// - /// Updated tag information to associate with the web test 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 WebTestsUpdateTagsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource 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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesGetViaIdentity(global::System.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 = @"2022-06-15"; + var apiVersion = @"2020-11-20"; // Constant Parameters 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/webtests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooktemplates/(?[^/]+)$", global::System.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/webtests/{webTestName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'"); } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; - var webTestName = _match.Groups["webTestName"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/microsoft.insights/webtests/" - + webTestName + + "/providers/microsoft.insights/workbooktemplates/" + + resourceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7610,28 +15880,178 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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.WebTestsUpdateTags_Call(request,onOk,eventListener,sender); + await this.WorkbookTemplatesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a single workbook template by its resourceName. + /// + /// 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 WorkbookTemplatesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-11-20"; + // Constant Parameters + 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/workbooktemplates/(?[^/]+)$", global::System.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/workbooktemplates/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooktemplates/" + + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbookTemplatesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a single workbook template by its resourceName. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// 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 WorkbookTemplatesGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-11-20"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/workbooktemplates/" + + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbookTemplatesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbookTemplatesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 WebTestsUpdateTags_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) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesGet_Call(global::System.Net.Http.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 ) { @@ -7642,6 +16062,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7649,12 +16070,14 @@ public partial class ApplicationInsightsManagementClient 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.Api20220615.WebTest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { - throw new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.UndeclaredResponseException(_response); + 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.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } } } @@ -7669,39 +16092,33 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call 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 WebTest resource. - /// Updated tag information to associate with the web test resource. + /// The name of the resource group. The name is case insensitive. + /// 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 WebTestsUpdateTags_Validate(string resourceGroupName, string subscriptionId, string webTestName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(webTestName),webTestName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); } } - /// Create a new workbook template. + /// Get all Workbook templates defined within a specified resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Application Insights component resource. - /// Properties that need to be specified to create a new workbook. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -7709,7 +16126,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkbookTemplatesListByResourceGroup(string subscriptionId, string resourceGroupName, 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-11-20"; // Constant Parameters @@ -7721,8 +16138,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/workbooktemplates/" - + global::System.Uri.EscapeDataString(resourceName) + + "/providers/microsoft.insights/workbooktemplates" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7731,24 +16147,18 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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.WorkbookTemplatesCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.WorkbookTemplatesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a new workbook template. + /// Get all Workbook templates defined within a specified resource group. /// - /// Properties that need to be specified to create a new workbook. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -7756,7 +16166,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkbookTemplatesListByResourceGroupViaIdentity(global::System.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-11-20"; // Constant Parameters @@ -7764,24 +16174,22 @@ public partial class ApplicationInsightsManagementClient { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooktemplates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooktemplates$", global::System.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/workbooktemplates/{resourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/microsoft.insights/workbooktemplates/" - + resourceName + + "/providers/microsoft.insights/workbooktemplates" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7790,23 +16198,170 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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.WorkbookTemplatesCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.WorkbookTemplatesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get all Workbook templates defined within a specified resource group. + /// + /// 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 WorkbookTemplatesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-11-20"; + // Constant Parameters + 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/workbooktemplates$", global::System.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/workbooktemplates'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooktemplates" + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbookTemplatesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get all Workbook templates defined within a specified resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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 WorkbookTemplatesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-11-20"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/workbooktemplates" + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbookTemplatesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbookTemplatesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -7814,7 +16369,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesListByResourceGroup_Call(global::System.Net.Http.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 ) { @@ -7825,6 +16380,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7832,19 +16388,13 @@ public partial class ApplicationInsightsManagementClient 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.Api20201120.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatesListResult.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.Api20201120.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -7860,18 +16410,16 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Application Insights component resource. - /// Properties that need to be specified to create a new workbook. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbookTemplatesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -7880,26 +16428,24 @@ public partial class ApplicationInsightsManagementClient await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a workbook template. + /// update a workbook template that has already been added. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. + /// Properties that need to be specified to patch a workbook template. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesDelete(string subscriptionId, string resourceGroupName, 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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters 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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-11-20"; // Constant Parameters @@ -7921,27 +16467,32 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbookTemplatesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.WorkbookTemplatesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a workbook template. + /// update a workbook template that has already been added. /// + /// Properties that need to be specified to patch a workbook template. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesDeleteViaIdentity(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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters 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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-11-20"; // Constant Parameters @@ -7975,99 +16526,81 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbookTemplatesDelete_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 WorkbookTemplatesDelete_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.Api20201120.WorkbookTemplateError.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(); - } + await this.WorkbookTemplatesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Application Insights component resource. + /// update a workbook template that has already been added. + /// + /// Properties that need to be specified to patch a workbook template. /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbookTemplatesDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task WorkbookTemplatesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-11-20"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooktemplates/(?[^/]+)$", global::System.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/workbooktemplates/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooktemplates/" + + 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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbookTemplatesUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a single workbook template by its resourceName. + /// update a workbook template that has already been added. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. + /// Json string supplied to the WorkbookTemplatesUpdate 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). @@ -8076,7 +16609,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesGet(string subscriptionId, string resourceGroupName, 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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2020-11-20"; // Constant Parameters @@ -8098,69 +16631,173 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbookTemplatesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbookTemplatesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a single workbook template by its resourceName. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a workbook template that has already been added. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Json string supplied to the WorkbookTemplatesUpdate operation /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesGetViaIdentity(global::System.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) + public async global::System.Threading.Tasks.Task WorkbookTemplatesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2020-11-20"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // 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/workbooktemplates/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooktemplates/(?[^/]+)$", global::System.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/workbooktemplates/{resourceName}'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbookTemplatesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a workbook template that has already been added. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Application Insights component resource. + /// Properties that need to be specified to patch a workbook template. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task WorkbookTemplatesUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-11-20"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/workbooktemplates/" - + resourceName + + 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkbookTemplatesGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkbookTemplatesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbookTemplatesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -8170,7 +16807,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbookTemplatesGet_Call(global::System.Net.Http.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) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesUpdate_Call(global::System.Net.Http.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 ) { @@ -8181,6 +16818,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8188,13 +16826,13 @@ public partial class ApplicationInsightsManagementClient 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.Api20201120.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate.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.Api20201120.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8210,17 +16848,18 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Application Insights component resource. + /// Properties that need to be specified to patch a workbook template. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbookTemplatesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbookTemplatesUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8230,23 +16869,30 @@ public partial class ApplicationInsightsManagementClient await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get all Workbook templates defined within a specified resource group. + /// update a new workbook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new workbook. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesListByResourceGroup(string subscriptionId, string resourceGroupName, 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) + public async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-11-20"; + var apiVersion = @"2022-04-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8256,8 +16902,11 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/workbooktemplates" + + "/providers/microsoft.insights/workbooks/" + + global::System.Uri.EscapeDataString(resourceName) + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8265,50 +16914,62 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbookTemplatesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbooksCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Get all Workbook templates defined within a specified resource group. + /// update a new workbook. /// + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new workbook. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesListByResourceGroupViaIdentity(global::System.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) + public async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-11-20"; + var apiVersion = @"2022-04-01"; // Constant Parameters 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/workbooktemplates$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks/(?[^/]+)$", global::System.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/workbooktemplates'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/microsoft.insights/workbooktemplates" + + "/providers/microsoft.insights/workbooks/" + + resourceName + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8316,104 +16977,146 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbookTemplatesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbooksCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a new workbook. + /// + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new workbook. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbookTemplatesListByResourceGroup_Call(global::System.Net.Http.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) + public async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-04-01"; + // Constant Parameters 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; + // verify that Identity format is an exact match for uri - 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.Api20201120.WorkbookTemplatesListResult.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.Api20201120.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooks/" + + resourceName + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbooksCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// + /// update a new workbook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Json string supplied to the WorkbooksCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbookTemplatesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, 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 = @"2022-04-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + // 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/workbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkbooksCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Updates a workbook template that has already been added. + /// update a new workbook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Application Insights component resource. - /// Properties that need to be specified to patch a workbook template. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The name of the resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Json string supplied to the WorkbooksCreateOrUpdate operation /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters 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) + public async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { - var apiVersion = @"2020-11-20"; + var apiVersion = @"2022-04-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8423,90 +17126,151 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/workbooktemplates/" + + "/providers/microsoft.insights/workbooks/" + global::System.Uri.EscapeDataString(resourceName) + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkbookTemplatesUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkbooksCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Updates a workbook template that has already been added. - /// - /// Properties that need to be specified to patch a workbook template. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a new workbook. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new workbook. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbookTemplatesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters 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) + public async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2020-11-20"; + var apiVersion = @"2022-04-01"; // Constant Parameters 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/workbooktemplates/(?[^/]+)$", global::System.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/workbooktemplates/{resourceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/microsoft.insights/workbooktemplates/" - + resourceName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/microsoft.insights/workbooks/" + + global::System.Uri.EscapeDataString(resourceName) + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkbookTemplatesUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkbooksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbooksCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -8514,7 +17278,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbookTemplatesUpdate_Call(global::System.Net.Http.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) + internal async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -8525,6 +17289,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8532,13 +17297,19 @@ public partial class ApplicationInsightsManagementClient 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.Api20201120.WorkbookTemplate.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.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.Api20201120.WorkbookTemplateError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8554,18 +17325,19 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get + /// Validation method for method. Call this like the actual call, but you will get /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Application Insights component resource. - /// Properties that need to be specified to patch a workbook template. + /// The name of the resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new workbook. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbookTemplatesUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8575,19 +17347,18 @@ public partial class ApplicationInsightsManagementClient await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(sourceId),sourceId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create a new workbook. + /// Delete a workbook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new workbook. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -8595,7 +17366,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkbooksDelete(string subscriptionId, string resourceGroupName, 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 = @"2022-04-01"; // Constant Parameters @@ -8610,8 +17381,6 @@ public partial class ApplicationInsightsManagementClient + "/providers/microsoft.insights/workbooks/" + global::System.Uri.EscapeDataString(resourceName) + "?" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8619,25 +17388,19 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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.WorkbooksCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.WorkbooksDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Create a new workbook. + /// Delete a workbook. /// - /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new workbook. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -8645,7 +17408,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkbooksDeleteViaIdentity(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 = @"2022-04-01"; // Constant Parameters @@ -8672,8 +17435,6 @@ public partial class ApplicationInsightsManagementClient + "/providers/microsoft.insights/workbooks/" + resourceName + "?" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8681,23 +17442,19 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::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.WorkbooksCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.WorkbooksDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -8705,7 +17462,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkbooksDelete_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 ) { @@ -8716,6 +17473,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8723,19 +17481,19 @@ public partial class ApplicationInsightsManagementClient 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.Api20220401.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } - case global::System.Net.HttpStatusCode.Created: + case global::System.Net.HttpStatusCode.NoContent: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + 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.Api20220401.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8751,19 +17509,17 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new workbook. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbooksDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8773,18 +17529,61 @@ public partial class ApplicationInsightsManagementClient await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertNotNull(nameof(sourceId),sourceId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a workbook. + /// Get a single workbook by its resourceName. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the resource. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 WorkbooksGet(string subscriptionId, string resourceGroupName, string resourceName, bool? canFetchContent, 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 = @"2022-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/workbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$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.WorkbooksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a single workbook by its resourceName. + /// + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -8792,49 +17591,62 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksDelete(string subscriptionId, string resourceGroupName, 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) + public async global::System.Threading.Tasks.Task WorkbooksGetViaIdentity(global::System.String viaIdentity, bool? canFetchContent, 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 = @"2022-04-01"; // Constant Parameters 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/workbooks/(?[^/]+)$", global::System.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/workbooks/{resourceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/microsoft.insights/workbooks/" - + global::System.Uri.EscapeDataString(resourceName) + + resourceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$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); + 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.WorkbooksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.WorkbooksGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a workbook. + /// Get a single workbook by its resourceName. /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksDeleteViaIdentity(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) + public async global::System.Threading.Tasks.Task WorkbooksGetViaIdentityWithResult(global::System.String viaIdentity, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2022-04-01"; // Constant Parameters @@ -8862,25 +17674,131 @@ public partial class ApplicationInsightsManagementClient + resourceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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; } + 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 null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbooksGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a single workbook by its resourceName. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// 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 WorkbooksGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/workbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkbooksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.WorkbooksGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbooksGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage 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. @@ -8888,7 +17806,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksDelete_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) + internal async global::System.Threading.Tasks.Task WorkbooksGet_Call(global::System.Net.Http.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 ) { @@ -8899,6 +17817,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8906,19 +17825,13 @@ public partial class ApplicationInsightsManagementClient 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); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.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.Api20220401.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8934,17 +17847,19 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the resource. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbooksGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8957,10 +17872,12 @@ public partial class ApplicationInsightsManagementClient } } - /// Get a single workbook by its resourceName. + /// Get all Workbooks defined within a specified resource group and category. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the resource. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. /// Flag indicating whether or not to return the full content for each applicable workbook. /// If false, only return summary content for workbooks. /// a delegate that is called when the remote service returns 200 (OK). @@ -8971,7 +17888,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksGet(string subscriptionId, string resourceGroupName, string resourceName, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task WorkbooksListByResourceGroup(string subscriptionId, string resourceGroupName, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, 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 = @"2022-04-01"; // Constant Parameters @@ -8983,12 +17900,17 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/microsoft.insights/workbooks/" - + global::System.Uri.EscapeDataString(resourceName) + + "/providers/microsoft.insights/workbooks" + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + "&" + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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; } @@ -9000,12 +17922,15 @@ public partial class ApplicationInsightsManagementClient await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbooksGet_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbooksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a single workbook by its resourceName. + /// Get all Workbooks defined within a specified resource group and category. /// + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. /// Flag indicating whether or not to return the full content for each applicable workbook. /// If false, only return summary content for workbooks. /// a delegate that is called when the remote service returns 200 (OK). @@ -9016,7 +17941,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksGetViaIdentity(global::System.String viaIdentity, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task WorkbooksListByResourceGroupViaIdentity(global::System.String viaIdentity, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, 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 = @"2022-04-01"; // Constant Parameters @@ -9024,44 +17949,224 @@ public partial class ApplicationInsightsManagementClient { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks$", global::System.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/workbooks/{resourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/microsoft.insights/workbooks/" - + resourceName + + "/providers/microsoft.insights/workbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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.WorkbooksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get all Workbooks defined within a specified resource group and category. + /// + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// 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 WorkbooksListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-04-01"; + // Constant Parameters + 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/workbooks$", global::System.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/workbooks'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooks" + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbooksListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get all Workbooks defined within a specified resource group and category. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// 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 WorkbooksListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/workbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + "&" + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkbooksGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkbooksListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbooksListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbooksListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -9071,7 +18176,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksGet_Call(global::System.Net.Http.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) + internal async global::System.Threading.Tasks.Task WorkbooksListByResourceGroup_Call(global::System.Net.Http.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 ) { @@ -9082,6 +18187,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9089,13 +18195,13 @@ public partial class ApplicationInsightsManagementClient 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.Api20220401.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbooksListResult.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.Api20220401.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9111,19 +18217,21 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the resource. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Azure Resource Id that will fetch all linked workbooks. /// Flag indicating whether or not to return the full content for each applicable workbook. /// If false, only return summary content for workbooks. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbooksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string category, System.Collections.Generic.List tags, string sourceId, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9132,16 +18240,15 @@ public partial class ApplicationInsightsManagementClient await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(category),category); + await eventListener.AssertNotNull(nameof(sourceId),sourceId); } } - /// Get all Workbooks defined within a specified resource group and category. + /// Get all Workbooks defined within a specified subscription and category. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// Category of workbook to return. /// Tags presents on each workbook returned. - /// Azure Resource Id that will fetch all linked workbooks. /// Flag indicating whether or not to return the full content for each applicable workbook. /// If false, only return summary content for workbooks. /// a delegate that is called when the remote service returns 200 (OK). @@ -9152,7 +18259,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksListByResourceGroup(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, string sourceId, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task WorkbooksListBySubscription(string subscriptionId, string category, System.Collections.Generic.List tags, bool? canFetchContent, 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 = @"2022-04-01"; // Constant Parameters @@ -9162,15 +18269,11 @@ public partial class ApplicationInsightsManagementClient var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/workbooks" + "?" + "category=" + global::System.Uri.EscapeDataString(category) + "&" - + (null != tags && tags.Length > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) - + "&" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + "&" @@ -9186,15 +18289,14 @@ public partial class ApplicationInsightsManagementClient await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbooksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbooksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get all Workbooks defined within a specified resource group and category. + /// Get all Workbooks defined within a specified subscription and category. /// /// Category of workbook to return. /// Tags presents on each workbook returned. - /// Azure Resource Id that will fetch all linked workbooks. /// Flag indicating whether or not to return the full content for each applicable workbook. /// If false, only return summary content for workbooks. /// a delegate that is called when the remote service returns 200 (OK). @@ -9205,7 +18307,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksListByResourceGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, string sourceId, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task WorkbooksListBySubscriptionViaIdentity(global::System.String viaIdentity, string category, System.Collections.Generic.List tags, bool? canFetchContent, 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 = @"2022-04-01"; // Constant Parameters @@ -9213,28 +18315,23 @@ public partial class ApplicationInsightsManagementClient { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/microsoft.insights/workbooks$", global::System.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/workbooks'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/microsoft.insights/workbooks'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName + "/providers/microsoft.insights/workbooks" + "?" + "category=" + global::System.Uri.EscapeDataString(category) + "&" - + (null != tags && tags.Length > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) - + "&" - + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + "&" @@ -9250,11 +18347,175 @@ public partial class ApplicationInsightsManagementClient await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbooksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbooksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get all Workbooks defined within a specified subscription and category. + /// + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// 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 WorkbooksListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, string category, System.Collections.Generic.List tags, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/microsoft.insights/workbooks$", 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/workbooks'"); + } + + // 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/workbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbooksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get all Workbooks defined within a specified subscription and category. + /// The ID of the target subscription. + /// Category of workbook to return. + /// Tags presents on each workbook returned. + /// Flag indicating whether or not to return the full content for each applicable workbook. + /// If false, only return summary content for workbooks. + /// 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 WorkbooksListBySubscriptionWithResult(string subscriptionId, string category, System.Collections.Generic.List tags, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/microsoft.insights/workbooks" + + "?" + + "category=" + global::System.Uri.EscapeDataString(category) + + "&" + + (null != tags && tags.Count > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbooksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbooksListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbooksListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -9264,7 +18525,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksListByResourceGroup_Call(global::System.Net.Http.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) + internal async global::System.Threading.Tasks.Task WorkbooksListBySubscription_Call(global::System.Net.Http.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 ) { @@ -9275,6 +18536,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9282,13 +18544,13 @@ public partial class ApplicationInsightsManagementClient 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.Api20220401.WorkbooksListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbooksListResult.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.Api20220401.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9304,41 +18566,76 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// Category of workbook to return. /// Tags presents on each workbook returned. - /// Azure Resource Id that will fetch all linked workbooks. /// Flag indicating whether or not to return the full content for each applicable workbook. /// If false, only return summary content for workbooks. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, string sourceId, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbooksListBySubscription_Validate(string subscriptionId, string category, System.Collections.Generic.List tags, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(category),category); - await eventListener.AssertEnum(nameof(category),category,@"workbook", @"TSG", @"performance", @"retention"); - await eventListener.AssertNotNull(nameof(sourceId),sourceId); } } - /// Get all Workbooks defined within a specified subscription and category. + /// Get a single workbook revision defined by its revisionId. /// The ID of the target subscription. - /// Category of workbook to return. - /// Tags presents on each workbook returned. - /// Flag indicating whether or not to return the full content for each applicable workbook. - /// If false, only return summary content for workbooks. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The id of the workbook's revision. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the 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 WorkbooksRevisionGet(string subscriptionId, string resourceGroupName, string resourceName, string revisionId, 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 = @"2022-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/workbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "/revisions/" + + global::System.Uri.EscapeDataString(revisionId) + + "?" + + "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.WorkbooksRevisionGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a single workbook revision defined by its revisionId. + /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -9347,24 +18644,36 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksListBySubscription(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task WorkbooksRevisionGetViaIdentity(global::System.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 = @"2022-04-01"; // Constant Parameters 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/workbooks/(?[^/]+)/revisions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions/{revisionId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var revisionId = _match.Groups["revisionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/microsoft.insights/workbooks" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooks/" + + resourceName + + "/revisions/" + + revisionId + "?" - + "category=" + global::System.Uri.EscapeDataString(category) - + "&" - + (null != tags && tags.Length > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) - + "&" - + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9377,25 +18686,19 @@ public partial class ApplicationInsightsManagementClient await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbooksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbooksRevisionGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get all Workbooks defined within a specified subscription and category. + /// Get a single workbook revision defined by its revisionId. /// - /// Category of workbook to return. - /// Tags presents on each workbook returned. - /// Flag indicating whether or not to return the full content for each applicable workbook. - /// If false, only return summary content for workbooks. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksListBySubscriptionViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, bool? canFetchContent, 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) + public async global::System.Threading.Tasks.Task WorkbooksRevisionGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2022-04-01"; // Constant Parameters @@ -9403,43 +18706,149 @@ public partial class ApplicationInsightsManagementClient { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/microsoft.insights/workbooks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks/(?[^/]+)/revisions/(?[^/]+)$", 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/workbooks'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions/{revisionId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + var revisionId = _match.Groups["revisionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/microsoft.insights/workbooks" + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooks/" + + resourceName + + "/revisions/" + + revisionId + "?" - + "category=" + global::System.Uri.EscapeDataString(category) - + "&" - + (null != tags && tags.Length > 0 ? "tags=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(tags, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) - + "&" - + (null == canFetchContent ? global::System.String.Empty : "canFetchContent=" + global::System.Uri.EscapeDataString(canFetchContent.ToString())) - + "&" + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbooksRevisionGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a single workbook revision defined by its revisionId. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The id of the workbook's revision. + /// 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 WorkbooksRevisionGetWithResult(string subscriptionId, string resourceGroupName, string resourceName, string revisionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/workbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "/revisions/" + + global::System.Uri.EscapeDataString(revisionId) + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkbooksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkbooksRevisionGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbooksRevisionGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -9449,7 +18858,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksListBySubscription_Call(global::System.Net.Http.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) + internal async global::System.Threading.Tasks.Task WorkbooksRevisionGet_Call(global::System.Net.Http.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 ) { @@ -9460,6 +18869,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9467,13 +18877,13 @@ public partial class ApplicationInsightsManagementClient 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.Api20220401.WorkbooksListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.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.Api20220401.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9489,34 +18899,35 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. - /// Category of workbook to return. - /// Tags presents on each workbook returned. - /// Flag indicating whether or not to return the full content for each applicable workbook. - /// If false, only return summary content for workbooks. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The id of the workbook's revision. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType category, string[] tags, bool? canFetchContent, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbooksRevisionGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string revisionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(category),category); - await eventListener.AssertEnum(nameof(category),category,@"workbook", @"TSG", @"performance", @"retention"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(resourceName),resourceName); + await eventListener.AssertNotNull(nameof(revisionId),revisionId); } } - /// Get a single workbook revision defined by its revisionId. + /// Get the revisions for the workbook defined by its resourceName. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// The id of the workbook's revision. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -9525,7 +18936,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksRevisionGet(string subscriptionId, string resourceGroupName, string resourceName, string revisionId, 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) + public async global::System.Threading.Tasks.Task WorkbooksRevisionsList(string subscriptionId, string resourceGroupName, 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 = @"2022-04-01"; // Constant Parameters @@ -9539,8 +18950,7 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/workbooks/" + global::System.Uri.EscapeDataString(resourceName) - + "/revisions/" - + global::System.Uri.EscapeDataString(revisionId) + + "/revisions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9554,11 +18964,11 @@ public partial class ApplicationInsightsManagementClient await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbooksRevisionGet_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbooksRevisionsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a single workbook revision defined by its revisionId. + /// Get the revisions for the workbook defined by its resourceName. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -9568,7 +18978,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksRevisionGetViaIdentity(global::System.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) + public async global::System.Threading.Tasks.Task WorkbooksRevisionsListViaIdentity(global::System.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 = @"2022-04-01"; // Constant Parameters @@ -9576,17 +18986,16 @@ public partial class ApplicationInsightsManagementClient { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks/(?[^/]+)/revisions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks/(?[^/]+)/revisions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions/{revisionId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var resourceName = _match.Groups["resourceName"].Value; - var revisionId = _match.Groups["revisionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -9595,8 +19004,7 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/workbooks/" + resourceName - + "/revisions/" - + revisionId + + "/revisions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9608,13 +19016,167 @@ public partial class ApplicationInsightsManagementClient 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.WorkbooksRevisionGet_Call(request,onOk,onDefault,eventListener,sender); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkbooksRevisionsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the revisions for the workbook defined by its resourceName. + /// + /// 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 WorkbooksRevisionsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-04-01"; + // Constant Parameters + 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/workbooks/(?[^/]+)/revisions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooks/" + + resourceName + + "/revisions" + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbooksRevisionsListWithResult_Call (request, eventListener,sender); + } + } + + /// Get the revisions for the workbook defined by its resourceName. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// 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 WorkbooksRevisionsListWithResult(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/workbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "/revisions" + + "?" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbooksRevisionsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbooksRevisionsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbooksListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -9624,7 +19186,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksRevisionGet_Call(global::System.Net.Http.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) + internal async global::System.Threading.Tasks.Task WorkbooksRevisionsList_Call(global::System.Net.Http.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 ) { @@ -9635,6 +19197,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9642,13 +19205,13 @@ public partial class ApplicationInsightsManagementClient 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.Api20220401.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbooksListResult.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.Api20220401.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9664,18 +19227,17 @@ public partial class ApplicationInsightsManagementClient } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// The id of the workbook's revision. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksRevisionGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string revisionId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbooksRevisionsList_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9685,23 +19247,26 @@ public partial class ApplicationInsightsManagementClient await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(resourceName),resourceName); - await eventListener.AssertNotNull(nameof(revisionId),revisionId); } } - /// Get the revisions for the workbook defined by its resourceName. + /// update a workbook that has already been added. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new workbook. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksRevisionsList(string subscriptionId, string resourceGroupName, 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) + public async global::System.Threading.Tasks.Task WorkbooksUpdate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-04-01"; // Constant Parameters @@ -9715,8 +19280,9 @@ public partial class ApplicationInsightsManagementClient + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/workbooks/" + global::System.Uri.EscapeDataString(resourceName) - + "/revisions" + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9724,26 +19290,34 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbooksRevisionsList_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbooksUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Get the revisions for the workbook defined by its resourceName. + /// update a workbook that has already been added. /// + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new workbook. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksRevisionsListViaIdentity(global::System.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) + public async global::System.Threading.Tasks.Task WorkbooksUpdateViaIdentity(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-04-01"; // Constant Parameters @@ -9751,10 +19325,10 @@ public partial class ApplicationInsightsManagementClient { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks/(?[^/]+)/revisions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks/(?[^/]+)$", global::System.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/workbooks/{resourceName}/revisions'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'"); } // replace URI parameters with values from identity @@ -9769,8 +19343,9 @@ public partial class ApplicationInsightsManagementClient + resourceGroupName + "/providers/microsoft.insights/workbooks/" + resourceName - + "/revisions" + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9778,104 +19353,144 @@ public partial class ApplicationInsightsManagementClient // generate request 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); + 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, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkbooksRevisionsList_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkbooksUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a workbook that has already been added. + /// + /// Azure Resource Id that will fetch all linked workbooks. + /// Properties that need to be specified to create a new workbook. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksRevisionsList_Call(global::System.Net.Http.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) + public async global::System.Threading.Tasks.Task WorkbooksUpdateViaIdentityWithResult(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-04-01"; + // Constant Parameters 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; + // verify that Identity format is an exact match for uri - 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.Api20220401.WorkbooksListResult.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.Api20220401.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/microsoft.insights/workbooks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var resourceName = _match.Groups["resourceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/microsoft.insights/workbooks/" + + resourceName + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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 null; } + + // generate request 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 null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkbooksUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// update a workbook that has already been added. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the resource. + /// Azure Resource Id that will fetch all linked workbooks. + /// Json string supplied to the WorkbooksUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbooksRevisionsList_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task WorkbooksUpdateViaJsonString(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, 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 = @"2022-04-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(resourceName),resourceName); + // 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/workbooks/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + + "&" + + "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(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkbooksUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Updates a workbook that has already been added. + /// update a workbook that has already been added. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Azure Resource Id that will fetch all linked workbooks. - /// Properties that need to be specified to create a new workbook. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the WorkbooksUpdate operation /// 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. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksUpdate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkbooksUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { var apiVersion = @"2022-04-01"; // Constant Parameters @@ -9895,86 +19510,140 @@ public partial class ApplicationInsightsManagementClient + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkbooksUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + return await this.WorkbooksUpdateWithResult_Call (request, eventListener,sender); } } - /// Updates a workbook that has already been added. - /// + /// update a workbook that has already been added. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. /// Azure Resource Id that will fetch all linked workbooks. /// Properties that need to be specified to create a new workbook. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the 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. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkbooksUpdateViaIdentity(global::System.String viaIdentity, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkbooksUpdateWithResult(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-04-01"; // Constant Parameters 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/workbooks/(?[^/]+)$", global::System.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/workbooks/{resourceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var resourceName = _match.Groups["resourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/microsoft.insights/workbooks/" - + resourceName + + global::System.Uri.EscapeDataString(resourceName) + "?" + (string.IsNullOrEmpty(sourceId) ? global::System.String.Empty : "sourceId=" + global::System.Uri.EscapeDataString(sourceId)) + "&" + "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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request 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.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkbooksUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + return await this.WorkbooksUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.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 WorkbooksUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, 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 null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 201 (Created). @@ -9985,7 +19654,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkbooksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9996,6 +19665,7 @@ public partial class ApplicationInsightsManagementClient 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; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -10003,19 +19673,19 @@ public partial class ApplicationInsightsManagementClient 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.Api20220401.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.Workbook.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.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.Api20220401.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -10043,7 +19713,7 @@ public partial class ApplicationInsightsManagementClient /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkbooksUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkbooksUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string sourceId, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.PowerShell.cs similarity index 68% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.PowerShell.cs index ac43d82f0a64..4f429f03e8da 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class Annotation partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,33 +78,33 @@ internal Annotation(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).EventTime = (global::System.DateTime?) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).Property = (string) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).RelatedAnnotation = (string) content.GetValueForProperty("RelatedAnnotation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).RelatedAnnotation, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,53 +119,53 @@ internal Annotation(global::System.Management.Automation.PSObject content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).EventTime = (global::System.DateTime?) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).Property = (string) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).RelatedAnnotation = (string) content.GetValueForProperty("RelatedAnnotation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal)this).RelatedAnnotation, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Annotation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Annotation(content); } @@ -175,7 +175,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.TypeConverter.cs index e0e09d103c03..2d3312796de1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.cs index 7a4341232756..3b2e51c16c06 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationInternal { /// Backing field for property. @@ -69,6 +69,9 @@ public partial interface IAnnotation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Category of annotation, free form", SerializedName = @"Category", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +80,9 @@ public partial interface IAnnotation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Time when event occurred", SerializedName = @"EventTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -85,6 +91,9 @@ public partial interface IAnnotation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Unique Id for annotation", SerializedName = @"Id", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +102,9 @@ public partial interface IAnnotation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of annotation", SerializedName = @"AnnotationName", PossibleTypes = new [] { typeof(string) })] @@ -101,6 +113,9 @@ public partial interface IAnnotation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Serialized JSON object for detailed properties", SerializedName = @"Properties", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +124,9 @@ public partial interface IAnnotation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Related parent annotation if any", SerializedName = @"RelatedAnnotation", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.json.cs index 3b283ee01ea1..33c3a64a7337 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,23 +65,23 @@ internal Annotation(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runti { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.PowerShell.cs similarity index 67% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.PowerShell.cs index 10fe2700efbd..4186d0727c49 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AnnotationError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,29 +78,29 @@ internal AnnotationError(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext = (string) content.GetValueForProperty("InnererrorDiagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).InnererrorTime = (global::System.DateTime?) content.GetValueForProperty("InnererrorTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -115,51 +115,49 @@ internal AnnotationError(global::System.Management.Automation.PSObject content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext = (string) content.GetValueForProperty("InnererrorDiagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal)this).InnererrorTime = (global::System.DateTime?) content.GetValueForProperty("InnererrorTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AnnotationError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AnnotationError(content); } @@ -169,7 +167,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.TypeConverter.cs index 64fb1cc1081c..f25f83c46c4b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.cs similarity index 79% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.cs index c6b82f1f7de1..efb4ad626e63 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal { /// Backing field for property. @@ -21,19 +21,19 @@ public partial class AnnotationError : public string Code { get => this._code; set => this._code = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError _innererror; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError Innererror { get => (this._innererror = this._innererror ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string InnererrorDiagnosticcontext { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorInternal)Innererror).Diagnosticcontext; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); } + public global::System.DateTime? InnererrorTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorInternal)Innererror).Time; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorInternal)Innererror).Time = value ?? default(global::System.DateTime); } /// Backing field for property. private string _message; @@ -43,7 +43,7 @@ public partial class AnnotationError : 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;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationErrorInternal.Innererror { get => (this._innererror = this._innererror ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.InnerError()); set { {_innererror = value;} } } /// Creates an new instance. public AnnotationError() @@ -59,6 +59,9 @@ public partial interface IAnnotationError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error detail code and explanation", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -67,6 +70,9 @@ public partial interface IAnnotationError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides correlation for request", SerializedName = @"diagnosticcontext", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +81,9 @@ public partial interface IAnnotationError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Request time", SerializedName = @"time", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -83,6 +92,9 @@ public partial interface IAnnotationError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error message", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -96,7 +108,7 @@ 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; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError Innererror { get; set; } /// Provides correlation for request string InnererrorDiagnosticcontext { get; set; } /// Request time diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.json.cs index 7c5c6e3989c0..bb7c91618216 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AnnotationError(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights. { 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;} + {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.PowerShell.cs similarity index 78% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.PowerShell.cs index 68ce5ecf9eb3..fc77d2100a9e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AnnotationsListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,13 +78,13 @@ internal AnnotationsListResult(global::System.Collections.IDictionary content) // 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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,33 @@ internal AnnotationsListResult(global::System.Management.Automation.PSObject con // 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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnnotationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AnnotationsListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AnnotationsListResult(content); } @@ -137,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.TypeConverter.cs index 968cfd3fd045..e9f83b7e2ac0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.cs similarity index 65% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.cs index 177f65974b4c..254885533168 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.cs @@ -3,25 +3,25 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] _value; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public AnnotationsListResult() @@ -37,10 +37,13 @@ public partial interface IAnnotationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation) })] + System.Collections.Generic.List Value { get; } } /// Annotations list result. @@ -48,7 +51,7 @@ internal partial interface IAnnotationsListResultInternal { /// An array of annotations. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.json.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.json.cs index 58dfec9fd014..b4581b15d4e1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AnnotationsListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationIns { 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;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Annotation.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -100,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.PowerShell.cs index c245d2f996ad..cf763773aefe 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -146,7 +146,7 @@ public override string ToString() return ToJsonString(); } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.cs index 6bac13bcb719..5c47bfc5490d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.json.cs index 451fa4f9fb41..8546f5731482 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.PowerShell.cs deleted file mode 100644 index 4d664bc44012..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.PowerShell.cs +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.PowerShell.cs deleted file mode 100644 index dd8afb8c3ec8..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.PowerShell.cs +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.PowerShell.cs deleted file mode 100644 index b3f34d7fe306..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.PowerShell.cs +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.dictionary.cs deleted file mode 100644 index 8bbc847e4967..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.dictionary.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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.Api20201120 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - public partial class WorkbookTemplatePropertiesLocalized : - 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGallery[] this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } - - /// - /// - public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGallery[] 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGallery[] value) => __additionalProperties.TryGetValue( key, out value); - - /// - - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesLocalized source) => source.__additionalProperties; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.PowerShell.cs deleted file mode 100644 index 322d4d2f8063..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.PowerShell.cs +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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.Api20210308 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// An Application Insights private workbook definition. - [System.ComponentModel.TypeConverter(typeof(MyWorkbookTypeConverter))] - public partial class MyWorkbook - { - - /// - /// 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.Api20210308.IMyWorkbook DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MyWorkbook(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.Api20210308.IMyWorkbook DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MyWorkbook(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.Api20210308.IMyWorkbook 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 MyWorkbook(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.Api20210308.IMyWorkbookInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); - } - if (content.Contains("UserAssignedIdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("UserAssignedIdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Etag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Etag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceEtagTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("SerializedData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SerializedData, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("TimeModified")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).TimeModified = (string) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).TimeModified, global::System.Convert.ToString); - } - if (content.Contains("Category")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Category, global::System.Convert.ToString); - } - if (content.Contains("PropertiesTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).PropertiesTag = (string[]) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("UserId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).UserId, global::System.Convert.ToString); - } - if (content.Contains("SourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SourceId, global::System.Convert.ToString); - } - if (content.Contains("StorageUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).StorageUri, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedAt, (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 MyWorkbook(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.Api20210308.IMyWorkbookInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); - } - if (content.Contains("UserAssignedIdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("UserAssignedIdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Etag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Etag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceEtagTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("SerializedData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SerializedData, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("TimeModified")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).TimeModified = (string) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).TimeModified, global::System.Convert.ToString); - } - if (content.Contains("Category")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).Category, global::System.Convert.ToString); - } - if (content.Contains("PropertiesTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).PropertiesTag = (string[]) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("UserId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).UserId, global::System.Convert.ToString); - } - if (content.Contains("SourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SourceId, global::System.Convert.ToString); - } - if (content.Contains("StorageUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).StorageUri, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal)this).SystemDataLastModifiedAt, (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(); - } - } - /// An Application Insights private workbook definition. - [System.ComponentModel.TypeConverter(typeof(MyWorkbookTypeConverter))] - public partial interface IMyWorkbook - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.PowerShell.cs deleted file mode 100644 index b6321f2d0971..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.PowerShell.cs +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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.Api20220401 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// A workbook definition. - [System.ComponentModel.TypeConverter(typeof(WorkbookTypeConverter))] - public partial class Workbook - { - - /// - /// 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.Api20220401.IWorkbook DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Workbook(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.Api20220401.IWorkbook DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Workbook(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.Api20220401.IWorkbook 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(); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Workbook(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.Api20220401.IWorkbookInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemDataTypeConverter.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("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("SerializedData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SerializedData, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("TimeModified")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).TimeModified = (global::System.DateTime?) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).TimeModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Category")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Category, global::System.Convert.ToString); - } - if (content.Contains("PropertiesTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).PropertiesTag = (string[]) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("UserId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).UserId, global::System.Convert.ToString); - } - if (content.Contains("SourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SourceId, global::System.Convert.ToString); - } - if (content.Contains("StorageUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).StorageUri, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Revision")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Revision, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedAt, (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 Workbook(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.Api20220401.IWorkbookInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemDataTypeConverter.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("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("SerializedData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SerializedData, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("TimeModified")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).TimeModified = (global::System.DateTime?) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).TimeModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Category")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Category, global::System.Convert.ToString); - } - if (content.Contains("PropertiesTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).PropertiesTag = (string[]) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("UserId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).UserId, global::System.Convert.ToString); - } - if (content.Contains("SourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SourceId, global::System.Convert.ToString); - } - if (content.Contains("StorageUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).StorageUri, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Revision")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).Revision, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(content); - } - } - /// A workbook definition. - [System.ComponentModel.TypeConverter(typeof(WorkbookTypeConverter))] - public partial interface IWorkbook - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.PowerShell.cs deleted file mode 100644 index 99fb0d5fd187..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.PowerShell.cs +++ /dev/null @@ -1,436 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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.Api20220615 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// An Application Insights WebTest definition. - [System.ComponentModel.TypeConverter(typeof(WebTestTypeConverter))] - public partial class WebTest - { - - /// - /// 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.Api20220615.IWebTest DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WebTest(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.Api20220615.IWebTest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WebTest(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.Api20220615.IWebTest 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(); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal WebTest(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.Api20220615.IWebTestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind.CreateFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Configuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("Request")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Request = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest) content.GetValueForProperty("Request",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesRequestTypeConverter.ConvertFrom); - } - if (content.Contains("ValidationRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRule = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules) content.GetValueForProperty("ValidationRule",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRule, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesTypeConverter.ConvertFrom); - } - if (content.Contains("SyntheticMonitorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).SyntheticMonitorId = (string) content.GetValueForProperty("SyntheticMonitorId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).SyntheticMonitorId, global::System.Convert.ToString); - } - if (content.Contains("WebTestName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).WebTestName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Frequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Frequency = (int?) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Frequency, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Timeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Timeout = (int?) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Timeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("WebTestKind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).WebTestKind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum) content.GetValueForProperty("WebTestKind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).WebTestKind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum.CreateFrom); - } - if (content.Contains("RetryEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RetryEnabled = (bool?) content.GetValueForProperty("RetryEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RetryEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PropertiesLocations")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).PropertiesLocations = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[]) content.GetValueForProperty("PropertiesLocations",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).PropertiesLocations, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocationTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ConfigurationWebTest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ConfigurationWebTest = (string) content.GetValueForProperty("ConfigurationWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ConfigurationWebTest, global::System.Convert.ToString); - } - if (content.Contains("RequestUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestUrl, global::System.Convert.ToString); - } - if (content.Contains("RequestHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestHeader = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]) content.GetValueForProperty("RequestHeader",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestHeader, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderFieldTypeConverter.ConvertFrom)); - } - if (content.Contains("RequestHttpVerb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestHttpVerb = (string) content.GetValueForProperty("RequestHttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestHttpVerb, global::System.Convert.ToString); - } - if (content.Contains("RequestBody")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestBody, global::System.Convert.ToString); - } - if (content.Contains("RequestParseDependentRequest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestParseDependentRequest = (bool?) content.GetValueForProperty("RequestParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RequestFollowRedirect")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestFollowRedirect = (bool?) content.GetValueForProperty("RequestFollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestFollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ValidationRuleContentValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ValidationRuleContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); - } - if (content.Contains("ValidationRuleSslCheck")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleSslCheck = (bool?) content.GetValueForProperty("ValidationRuleSslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleSslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ValidationRuleSslCertRemainingLifetimeCheck")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleSslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("ValidationRuleSslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleSslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ValidationRuleExpectedHttpStatusCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleExpectedHttpStatusCode = (int?) content.GetValueForProperty("ValidationRuleExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ValidationRuleIgnoreHttpsStatusCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleIgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("ValidationRuleIgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleIgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ContentValidationContentMatch")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); - } - if (content.Contains("ContentValidationIgnoreCase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ContentValidationPassIfTextFound")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationPassIfTextFound, (__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 WebTest(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.Api20220615.IWebTestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind.CreateFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Configuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("Request")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Request = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest) content.GetValueForProperty("Request",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesRequestTypeConverter.ConvertFrom); - } - if (content.Contains("ValidationRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRule = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules) content.GetValueForProperty("ValidationRule",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRule, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesTypeConverter.ConvertFrom); - } - if (content.Contains("SyntheticMonitorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).SyntheticMonitorId = (string) content.GetValueForProperty("SyntheticMonitorId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).SyntheticMonitorId, global::System.Convert.ToString); - } - if (content.Contains("WebTestName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).WebTestName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Frequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Frequency = (int?) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Frequency, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Timeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Timeout = (int?) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).Timeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("WebTestKind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).WebTestKind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum) content.GetValueForProperty("WebTestKind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).WebTestKind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum.CreateFrom); - } - if (content.Contains("RetryEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RetryEnabled = (bool?) content.GetValueForProperty("RetryEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RetryEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PropertiesLocations")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).PropertiesLocations = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[]) content.GetValueForProperty("PropertiesLocations",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).PropertiesLocations, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocationTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ConfigurationWebTest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ConfigurationWebTest = (string) content.GetValueForProperty("ConfigurationWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ConfigurationWebTest, global::System.Convert.ToString); - } - if (content.Contains("RequestUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestUrl, global::System.Convert.ToString); - } - if (content.Contains("RequestHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestHeader = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]) content.GetValueForProperty("RequestHeader",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestHeader, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderFieldTypeConverter.ConvertFrom)); - } - if (content.Contains("RequestHttpVerb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestHttpVerb = (string) content.GetValueForProperty("RequestHttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestHttpVerb, global::System.Convert.ToString); - } - if (content.Contains("RequestBody")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestBody, global::System.Convert.ToString); - } - if (content.Contains("RequestParseDependentRequest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestParseDependentRequest = (bool?) content.GetValueForProperty("RequestParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RequestFollowRedirect")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestFollowRedirect = (bool?) content.GetValueForProperty("RequestFollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).RequestFollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ValidationRuleContentValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ValidationRuleContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); - } - if (content.Contains("ValidationRuleSslCheck")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleSslCheck = (bool?) content.GetValueForProperty("ValidationRuleSslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleSslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ValidationRuleSslCertRemainingLifetimeCheck")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleSslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("ValidationRuleSslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleSslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ValidationRuleExpectedHttpStatusCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleExpectedHttpStatusCode = (int?) content.GetValueForProperty("ValidationRuleExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ValidationRuleIgnoreHttpsStatusCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleIgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("ValidationRuleIgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ValidationRuleIgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ContentValidationContentMatch")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); - } - if (content.Contains("ContentValidationIgnoreCase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ContentValidationPassIfTextFound")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal)this).ContentValidationPassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - AfterDeserializePSObject(content); - } - } - /// An Application Insights WebTest definition. - [System.ComponentModel.TypeConverter(typeof(WebTestTypeConverter))] - public partial interface IWebTest - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.PowerShell.cs deleted file mode 100644 index b5482be00639..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.PowerShell.cs +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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.Api20220615 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// Metadata describing a web test for an Azure resource. - [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesTypeConverter))] - public partial class WebTestProperties - { - - /// - /// 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.Api20220615.IWebTestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WebTestProperties(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.Api20220615.IWebTestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WebTestProperties(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.Api20220615.IWebTestProperties 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(); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal WebTestProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Configuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("Request")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Request = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest) content.GetValueForProperty("Request",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesRequestTypeConverter.ConvertFrom); - } - if (content.Contains("ValidationRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRule = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules) content.GetValueForProperty("ValidationRule",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRule, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesTypeConverter.ConvertFrom); - } - if (content.Contains("SyntheticMonitorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).SyntheticMonitorId = (string) content.GetValueForProperty("SyntheticMonitorId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).SyntheticMonitorId, global::System.Convert.ToString); - } - if (content.Contains("WebTestName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).WebTestName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Frequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Frequency = (int?) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Frequency, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Timeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Timeout = (int?) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Timeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("WebTestKind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).WebTestKind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum) content.GetValueForProperty("WebTestKind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).WebTestKind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum.CreateFrom); - } - if (content.Contains("RetryEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RetryEnabled = (bool?) content.GetValueForProperty("RetryEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RetryEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Location = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocationTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ConfigurationWebTest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ConfigurationWebTest = (string) content.GetValueForProperty("ConfigurationWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ConfigurationWebTest, global::System.Convert.ToString); - } - if (content.Contains("RequestUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestUrl, global::System.Convert.ToString); - } - if (content.Contains("RequestHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestHeader = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]) content.GetValueForProperty("RequestHeader",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestHeader, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderFieldTypeConverter.ConvertFrom)); - } - if (content.Contains("RequestHttpVerb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestHttpVerb = (string) content.GetValueForProperty("RequestHttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestHttpVerb, global::System.Convert.ToString); - } - if (content.Contains("RequestBody")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestBody, global::System.Convert.ToString); - } - if (content.Contains("RequestParseDependentRequest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestParseDependentRequest = (bool?) content.GetValueForProperty("RequestParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RequestFollowRedirect")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestFollowRedirect = (bool?) content.GetValueForProperty("RequestFollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestFollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ValidationRuleContentValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ValidationRuleContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); - } - if (content.Contains("ValidationRuleSslCheck")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleSslCheck = (bool?) content.GetValueForProperty("ValidationRuleSslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleSslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ValidationRuleSslCertRemainingLifetimeCheck")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleSslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("ValidationRuleSslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleSslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ValidationRuleExpectedHttpStatusCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleExpectedHttpStatusCode = (int?) content.GetValueForProperty("ValidationRuleExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ValidationRuleIgnoreHttpsStatusCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleIgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("ValidationRuleIgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleIgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ContentValidationContentMatch")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); - } - if (content.Contains("ContentValidationIgnoreCase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ContentValidationPassIfTextFound")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationPassIfTextFound, (__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 WebTestProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Configuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("Request")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Request = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest) content.GetValueForProperty("Request",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesRequestTypeConverter.ConvertFrom); - } - if (content.Contains("ValidationRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRule = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules) content.GetValueForProperty("ValidationRule",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRule, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesTypeConverter.ConvertFrom); - } - if (content.Contains("SyntheticMonitorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).SyntheticMonitorId = (string) content.GetValueForProperty("SyntheticMonitorId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).SyntheticMonitorId, global::System.Convert.ToString); - } - if (content.Contains("WebTestName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).WebTestName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Frequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Frequency = (int?) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Frequency, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Timeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Timeout = (int?) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Timeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("WebTestKind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).WebTestKind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum) content.GetValueForProperty("WebTestKind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).WebTestKind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum.CreateFrom); - } - if (content.Contains("RetryEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RetryEnabled = (bool?) content.GetValueForProperty("RetryEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RetryEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Location = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocationTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ConfigurationWebTest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ConfigurationWebTest = (string) content.GetValueForProperty("ConfigurationWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ConfigurationWebTest, global::System.Convert.ToString); - } - if (content.Contains("RequestUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestUrl, global::System.Convert.ToString); - } - if (content.Contains("RequestHeader")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestHeader = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]) content.GetValueForProperty("RequestHeader",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestHeader, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderFieldTypeConverter.ConvertFrom)); - } - if (content.Contains("RequestHttpVerb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestHttpVerb = (string) content.GetValueForProperty("RequestHttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestHttpVerb, global::System.Convert.ToString); - } - if (content.Contains("RequestBody")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestBody, global::System.Convert.ToString); - } - if (content.Contains("RequestParseDependentRequest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestParseDependentRequest = (bool?) content.GetValueForProperty("RequestParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RequestFollowRedirect")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestFollowRedirect = (bool?) content.GetValueForProperty("RequestFollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).RequestFollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ValidationRuleContentValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ValidationRuleContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); - } - if (content.Contains("ValidationRuleSslCheck")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleSslCheck = (bool?) content.GetValueForProperty("ValidationRuleSslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleSslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ValidationRuleSslCertRemainingLifetimeCheck")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleSslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("ValidationRuleSslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleSslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ValidationRuleExpectedHttpStatusCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleExpectedHttpStatusCode = (int?) content.GetValueForProperty("ValidationRuleExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ValidationRuleIgnoreHttpsStatusCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleIgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("ValidationRuleIgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ValidationRuleIgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ContentValidationContentMatch")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); - } - if (content.Contains("ContentValidationIgnoreCase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ContentValidationPassIfTextFound")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)this).ContentValidationPassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - AfterDeserializePSObject(content); - } - } - /// Metadata describing a web test for an Azure resource. - [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesTypeConverter))] - public partial interface IWebTestProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.PowerShell.cs similarity index 75% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.PowerShell.cs index c21fb26c76dc..d6d601b8dd26 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApiKeyRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal ApiKeyRequest(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).LinkedReadProperty = (System.Collections.Generic.List) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToList(__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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).LinkedWriteProperty = (System.Collections.Generic.List) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,41 +107,41 @@ internal ApiKeyRequest(global::System.Management.Automation.PSObject content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).LinkedReadProperty = (System.Collections.Generic.List) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToList(__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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).LinkedWriteProperty = (System.Collections.Generic.List) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApiKeyRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApiKeyRequest(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.TypeConverter.cs index c7c9fb09a828..a555e5bf3caa 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.cs similarity index 77% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.cs index 314a852a958e..0fa4cd5cb88e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.cs @@ -3,29 +3,29 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequestInternal { /// Backing field for property. - private string[] _linkedReadProperty; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List LinkedReadProperty { get => this._linkedReadProperty; set => this._linkedReadProperty = value; } /// Backing field for property. - private string[] _linkedWriteProperty; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List LinkedWriteProperty { get => this._linkedWriteProperty; set => this._linkedWriteProperty = value; } /// Backing field for property. private string _name; @@ -48,22 +48,31 @@ public partial interface IApiKeyRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The read access rights of this API Key.", SerializedName = @"linkedReadProperties", PossibleTypes = new [] { typeof(string) })] - string[] LinkedReadProperty { get; set; } + System.Collections.Generic.List LinkedReadProperty { get; set; } /// The write access rights of this API Key. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The write access rights of this API Key.", SerializedName = @"linkedWriteProperties", PossibleTypes = new [] { typeof(string) })] - string[] LinkedWriteProperty { get; set; } + System.Collections.Generic.List LinkedWriteProperty { get; set; } /// The name of the API Key. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the API Key.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -75,9 +84,9 @@ internal partial interface IApiKeyRequestInternal { /// The read access rights of this API Key. - string[] LinkedReadProperty { get; set; } + System.Collections.Generic.List LinkedReadProperty { get; set; } /// The write access rights of this API Key. - string[] LinkedWriteProperty { get; set; } + System.Collections.Generic.List LinkedWriteProperty { get; set; } /// The name of the API Key. string Name { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.json.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.json.cs index 25afee78715c..455dc9df0972 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApiKeyRequest.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApiKeyRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ApiKeyRequest(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Ru { 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;} + {_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.ToList(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.ToList(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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApiKeyRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.PowerShell.cs new file mode 100644 index 000000000000..c50608ef0b4f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.PowerShell.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.Models +{ + 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.IApplicationInsightsComponentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ApplicationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ApplicationType = (string) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ApplicationType, global::System.Convert.ToString); + } + if (content.Contains("FlowType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).FlowType = (string) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).FlowType, global::System.Convert.ToString); + } + if (content.Contains("RequestSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).RequestSource = (string) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).RequestSource, global::System.Convert.ToString); + } + if (content.Contains("IngestionMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).IngestionMode = (string) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).IngestionMode, global::System.Convert.ToString); + } + if (content.Contains("ApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).AppId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("CreationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IApplicationInsightsComponentInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).HockeyAppId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).HockeyAppToken, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SamplingPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).SamplingPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisableIPMasking")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).DisableIPMasking, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmediatePurgeDataOn30Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LaMigrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource = (System.Collections.Generic.List) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PrivateLinkScopedResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccessForIngestion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion = (string) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccessForQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery = (string) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery, global::System.Convert.ToString); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ForceCustomerStorageForProfiler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IApplicationInsightsComponentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ApplicationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ApplicationType = (string) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ApplicationType, global::System.Convert.ToString); + } + if (content.Contains("FlowType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).FlowType = (string) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).FlowType, global::System.Convert.ToString); + } + if (content.Contains("RequestSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).RequestSource = (string) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).RequestSource, global::System.Convert.ToString); + } + if (content.Contains("IngestionMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).IngestionMode = (string) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).IngestionMode, global::System.Convert.ToString); + } + if (content.Contains("ApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).AppId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("CreationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IApplicationInsightsComponentInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).HockeyAppId, global::System.Convert.ToString); + } + if (content.Contains("HockeyAppToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).HockeyAppToken, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SamplingPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).SamplingPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisableIPMasking")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).DisableIPMasking, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmediatePurgeDataOn30Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).WorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LaMigrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource = (System.Collections.Generic.List) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.PrivateLinkScopedResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccessForIngestion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion = (string) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion, global::System.Convert.ToString); + } + if (content.Contains("PublicNetworkAccessForQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery = (string) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery, global::System.Convert.ToString); + } + if (content.Contains("DisableLocalAuth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ForceCustomerStorageForProfiler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.TypeConverter.cs index a389b3728f78..cb60e062e856 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.cs similarity index 64% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.cs index bf2721180d89..2c19f66401a0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.cs @@ -3,51 +3,51 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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.Models.IApplicationInsightsComponent, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource __componentsResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)""); } + public string ApplicationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationType = value ?? null; } /// 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; } + public string ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public global::System.DateTime? CreationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); } + public bool? DisableIPMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).DisableIPMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); } + public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } /// Backing field for property. private string _etag; @@ -61,35 +61,37 @@ public partial class ApplicationInsightsComponent : /// 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)""); } + public string FlowType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).FlowType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).FlowType = value ?? null; } /// 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); } + public bool? ForceCustomerStorageForProfiler { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ForceCustomerStorageForProfiler; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ForceCustomerStorageForProfiler = value ?? default(bool); } /// /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// Please visit external url https://aka.ms/ewjuel to get more information. /// [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; } + public string HockeyAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppId = value ?? null; } /// - /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// Token used to authenticate communications with between Application Insights and HockeyApp. Please visit external url https://aka.ms/sls76s + /// to get more information. /// [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; } + public string HockeyAppToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); } + public bool? ImmediatePurgeDataOn30Day { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ImmediatePurgeDataOn30Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)""); } + public string IngestionMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).IngestionMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).IngestionMode = value ?? null; } /// /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for @@ -97,7 +99,7 @@ public partial class ApplicationInsightsComponent : /// 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; } + public string InstrumentationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey; } /// Backing field for property. private string _kind; @@ -111,97 +113,97 @@ public partial class ApplicationInsightsComponent : /// 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; } + public global::System.DateTime? LaMigrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 ; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)__componentsResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)__componentsResource).Location = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).AppId = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationId = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ConnectionString = value ?? null; } /// 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; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.CreationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).CreationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).CreationDate = value ?? default(global::System.DateTime); } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.HockeyAppToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppToken = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.InstrumentationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey = value ?? null; } /// 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; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.LaMigrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).LaMigrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).LaMigrationDate = value ?? default(global::System.DateTime); } /// 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; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.PrivateLinkScopedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).PrivateLinkScopedResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).PrivateLinkScopedResource = value ?? null /* arrayOf */; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).Name = value ?? null; } /// 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;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).ProvisioningState = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentInternal.TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).TenantId = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)__componentsResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)__componentsResource).Id = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)__componentsResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)__componentsResource).Name = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)__componentsResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)__componentsResource).Type = value ?? null; } /// 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; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public System.Collections.Generic.List PrivateLinkScopedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)""); } + public string PublicNetworkAccessForIngestion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForIngestion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForIngestion = value ?? null; } /// 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)""); } + public string PublicNetworkAccessForQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForQuery = value ?? null; } /// /// 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)""); } + public string RequestSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).RequestSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).RequestSource = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] @@ -209,32 +211,33 @@ public partial class ApplicationInsightsComponent : /// 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); } + public int? RetentionInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).RetentionInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).RetentionInDay = value ?? default(int); } /// /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// Please visit external url https://aka.ms/sl0yqd to get more information. /// [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); } + public double? SamplingPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).SamplingPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)__componentsResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string WorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).WorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).WorkspaceResourceId = value ?? null; } /// Creates an new instance. public ApplicationInsightsComponent() @@ -257,12 +260,15 @@ public ApplicationInsightsComponent() /// An Application Insights component definition. public partial interface IApplicationInsightsComponent : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource { /// Application Insights Unique ID for your Application. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Application Insights Unique ID for your Application.", SerializedName = @"AppId", PossibleTypes = new [] { typeof(string) })] @@ -273,6 +279,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The unique ID of your application. This field mirrors the 'Name' field and cannot be changed.", SerializedName = @"ApplicationId", PossibleTypes = new [] { typeof(string) })] @@ -281,14 +290,21 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] + string ApplicationType { get; set; } /// Application Insights component connection string. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Application Insights component connection string.", SerializedName = @"ConnectionString", PossibleTypes = new [] { typeof(string) })] @@ -297,6 +313,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Creation Date for the Application Insights component, in ISO 8601 format.", SerializedName = @"CreationDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -305,6 +324,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Disable IP masking.", SerializedName = @"DisableIpMasking", PossibleTypes = new [] { typeof(bool) })] @@ -313,6 +335,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Disable Non-AAD based Auth.", SerializedName = @"DisableLocalAuth", PossibleTypes = new [] { typeof(bool) })] @@ -321,6 +346,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource etag", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -332,35 +360,50 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] + string 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, + Read = true, + Create = true, + Update = true, 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. + /// Please visit external url https://aka.ms/ewjuel to get more information. /// [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.", + Read = true, + Create = true, + Update = true, + Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. Please visit external url https://aka.ms/ewjuel to get more information.", SerializedName = @"HockeyAppId", PossibleTypes = new [] { typeof(string) })] string HockeyAppId { get; set; } /// - /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// Token used to authenticate communications with between Application Insights and HockeyApp. Please visit external url https://aka.ms/sls76s + /// to get more information. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, - Description = @"Token used to authenticate communications with between Application Insights and HockeyApp.", + Read = true, + Create = false, + Update = false, + Description = @"Token used to authenticate communications with between Application Insights and HockeyApp. Please visit external url https://aka.ms/sls76s to get more information.", SerializedName = @"HockeyAppToken", PossibleTypes = new [] { typeof(string) })] string HockeyAppToken { get; } @@ -368,6 +411,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Purge data immediately after 30 days.", SerializedName = @"ImmediatePurgeDataOn30Days", PossibleTypes = new [] { typeof(bool) })] @@ -376,10 +422,14 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] + string 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 @@ -388,6 +438,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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) })] @@ -399,6 +452,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -407,6 +463,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The date which the component got migrated to LA, in ISO 8601 format.", SerializedName = @"LaMigrationDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -415,14 +474,20 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource) })] + System.Collections.Generic.List PrivateLinkScopedResource { get; } /// Application name. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Application name.", SerializedName = @"Name", PossibleTypes = new [] { typeof(string) })] @@ -434,6 +499,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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) })] @@ -442,18 +510,26 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccessForIngestion { get; set; } /// The network access type for accessing Application Insights query. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccessForQuery { get; set; } /// /// Describes what tool created this Application Insights component. Customers using this API should set this to the default /// 'rest'. @@ -461,25 +537,36 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] + string RequestSource { get; set; } /// Retention period in days. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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. + /// Please visit external url https://aka.ms/sl0yqd to get more information. /// [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.", + Read = true, + Create = true, + Update = true, + Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. Please visit external url https://aka.ms/sl0yqd to get more information.", SerializedName = @"SamplingPercentage", PossibleTypes = new [] { typeof(double) })] double? SamplingPercentage { get; set; } @@ -487,6 +574,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure Tenant Id.", SerializedName = @"TenantId", PossibleTypes = new [] { typeof(string) })] @@ -498,6 +588,9 @@ public partial interface IApplicationInsightsComponent : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -506,7 +599,7 @@ public partial interface IApplicationInsightsComponent : } /// An Application Insights component definition. internal partial interface IApplicationInsightsComponentInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal { /// Application Insights Unique ID for your Application. string AppId { get; set; } @@ -515,7 +608,8 @@ internal partial interface IApplicationInsightsComponentInternal : /// string ApplicationId { get; set; } /// Type of application being monitored. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType? ApplicationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] + string ApplicationType { get; set; } /// Application Insights component connection string. string ConnectionString { get; set; } /// Creation Date for the Application Insights component, in ISO 8601 format. @@ -530,21 +624,25 @@ internal partial interface IApplicationInsightsComponentInternal : /// 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; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] + string 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. + /// Please visit external url https://aka.ms/ewjuel to get more information. /// string HockeyAppId { get; set; } /// - /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// Token used to authenticate communications with between Application Insights and HockeyApp. Please visit external url https://aka.ms/sls76s + /// to get more information. /// 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; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] + string 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 @@ -559,29 +657,33 @@ internal partial interface IApplicationInsightsComponentInternal : /// 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; } + System.Collections.Generic.List 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; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccessForIngestion { get; set; } /// The network access type for accessing Application Insights query. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string 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; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] + string 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. + /// Please visit external url https://aka.ms/sl0yqd to get more information. /// double? SamplingPercentage { get; set; } /// Azure Tenant Id. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.json.cs similarity index 92% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.json.cs index f0236f754b20..266f5396cc63 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ApplicationInsightsComponent(Microsoft.Azure.PowerShell.Cmdlets.Applica { 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;} + __componentsResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.PowerShell.cs similarity index 65% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.PowerShell.cs index 96970a133799..9c5667869e90 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApplicationInsightsComponentApiKey partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,33 +78,33 @@ internal ApplicationInsightsComponentApiKey(global::System.Collections.IDictiona // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate = (string) content.GetValueForProperty("CreatedDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty = (System.Collections.Generic.List) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToList(__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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty = (System.Collections.Generic.List) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,55 +119,55 @@ internal ApplicationInsightsComponentApiKey(global::System.Management.Automation // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate = (string) content.GetValueForProperty("CreatedDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty = (System.Collections.Generic.List) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToList(__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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty = (System.Collections.Generic.List) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentApiKey(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentApiKey(content); } @@ -179,7 +179,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.TypeConverter.cs index c38d59755bf8..2168022e16a1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.cs similarity index 83% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.cs index a1e1b86c6ff3..3c08b6975c2f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal { /// Backing field for property. @@ -37,24 +37,24 @@ public partial class ApplicationInsightsComponentApiKey : public string Id { get => this._id; } /// Backing field for property. - private string[] _linkedReadProperty; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List LinkedReadProperty { get => this._linkedReadProperty; set => this._linkedReadProperty = value; } /// Backing field for property. - private string[] _linkedWriteProperty; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyInternal.Id { get => this._id; set { {_id = value;} } } /// Backing field for property. private string _name; @@ -81,6 +81,9 @@ public partial interface IApplicationInsightsComponentApiKey : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The API key value. It will be only return once when the API Key was created.", SerializedName = @"apiKey", PossibleTypes = new [] { typeof(string) })] @@ -89,6 +92,9 @@ public partial interface IApplicationInsightsComponentApiKey : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The create date of this API key.", SerializedName = @"createdDate", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +105,9 @@ public partial interface IApplicationInsightsComponentApiKey : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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) })] @@ -107,22 +116,31 @@ public partial interface IApplicationInsightsComponentApiKey : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The read access rights of this API Key.", SerializedName = @"linkedReadProperties", PossibleTypes = new [] { typeof(string) })] - string[] LinkedReadProperty { get; set; } + System.Collections.Generic.List LinkedReadProperty { get; set; } /// The write access rights of this API Key. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The write access rights of this API Key.", SerializedName = @"linkedWriteProperties", PossibleTypes = new [] { typeof(string) })] - string[] LinkedWriteProperty { get; set; } + System.Collections.Generic.List LinkedWriteProperty { get; set; } /// The name of the API key. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the API key.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -142,9 +160,9 @@ internal partial interface IApplicationInsightsComponentApiKeyInternal /// string Id { get; set; } /// The read access rights of this API Key. - string[] LinkedReadProperty { get; set; } + System.Collections.Generic.List LinkedReadProperty { get; set; } /// The write access rights of this API Key. - string[] LinkedWriteProperty { get; set; } + System.Collections.Generic.List LinkedWriteProperty { get; set; } /// The name of the API key. string Name { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.json.cs similarity index 89% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.json.cs index d03f9018067d..f8fc9ef8cf76 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,23 +65,23 @@ internal ApplicationInsightsComponentApiKey(Microsoft.Azure.PowerShell.Cmdlets.A { 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;} + {_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.ToList(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.ToList(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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -106,11 +106,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.PowerShell.cs similarity index 76% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.PowerShell.cs index 7a712c4c406b..e8e878aac2f9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApplicationInsightsComponentApiKeyListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,13 +78,13 @@ internal ApplicationInsightsComponentApiKeyListResult(global::System.Collections // 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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKeyTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,35 @@ internal ApplicationInsightsComponentApiKeyListResult(global::System.Management. // 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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKeyTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentApiKeyListResult(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentApiKeyListResult(content); } @@ -140,7 +140,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.TypeConverter.cs index 24f55e3f997f..7742d894da5b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.cs index a5e3061ebbf6..199ae8ff2411 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.cs @@ -3,22 +3,22 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] _value; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// /// Creates an new instance. @@ -36,10 +36,13 @@ public partial interface IApplicationInsightsComponentApiKeyListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey) })] + System.Collections.Generic.List Value { get; set; } } /// Describes the list of API Keys of an Application Insights Component. @@ -47,7 +50,7 @@ internal partial interface IApplicationInsightsComponentApiKeyListResultInternal { /// List of API Key definitions. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.json.cs similarity index 89% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.json.cs index 5c5d5e7411ad..8d75a533351c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -66,18 +66,18 @@ internal ApplicationInsightsComponentApiKeyListResult(Microsoft.Azure.PowerShell { 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;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentApiKey.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.PowerShell.cs similarity index 76% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.PowerShell.cs index ad9872d99864..1ab36bce78c2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApplicationInsightsComponentAvailableFeatures partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,13 +78,13 @@ internal ApplicationInsightsComponentAvailableFeatures(global::System.Collection // 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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeaturesInternal)this).Result = (System.Collections.Generic.List) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeaturesInternal)this).Result, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeatureTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,35 @@ internal ApplicationInsightsComponentAvailableFeatures(global::System.Management // 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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeaturesInternal)this).Result = (System.Collections.Generic.List) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeaturesInternal)this).Result, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeatureTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentAvailableFeatures(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentAvailableFeatures(content); } @@ -140,7 +140,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.TypeConverter.cs index a1be01ed89ec..b2af16feeac9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.cs similarity index 64% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.cs index a204b1daa06c..0efde4111b22 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.cs @@ -3,25 +3,25 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeaturesInternal.Result { get => this._result; set { {_result = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] _result; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List Result { get => this._result; } /// /// Creates an new instance. @@ -39,10 +39,13 @@ public partial interface IApplicationInsightsComponentAvailableFeatures : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature) })] + System.Collections.Generic.List Result { get; } } /// An Application Insights component available features. @@ -50,7 +53,7 @@ internal partial interface IApplicationInsightsComponentAvailableFeaturesInterna { /// A list of Application Insights component feature. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] Result { get; set; } + System.Collections.Generic.List Result { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.json.cs similarity index 89% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.json.cs index c426e6f083d2..06e98db30569 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -66,18 +66,18 @@ internal ApplicationInsightsComponentAvailableFeatures(Microsoft.Azure.PowerShel { 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;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentFeature.FromJson(__u) )) ))() : null : _result;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -103,7 +103,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { if (null != this._result) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.PowerShell.cs similarity index 56% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.PowerShell.cs index 998120b7b8ba..06e701f9c06e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApplicationInsightsComponentBillingFeatures partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,41 +78,41 @@ internal ApplicationInsightsComponentBillingFeatures(global::System.Collections. // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap) content.GetValueForProperty("DataVolumeCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature = (System.Collections.Generic.List) content.GetValueForProperty("CurrentBillingFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature, __y => TypeConverterExtensions.SelectToList(__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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap = (float?) content.GetValueForProperty("DataVolumeCapCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime = (int?) content.GetValueForProperty("DataVolumeCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold = (int?) content.GetValueForProperty("DataVolumeCapWarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap = (float?) content.GetValueForProperty("DataVolumeCapMaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -127,63 +127,63 @@ internal ApplicationInsightsComponentBillingFeatures(global::System.Management.A // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap) content.GetValueForProperty("DataVolumeCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature = (System.Collections.Generic.List) content.GetValueForProperty("CurrentBillingFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature, __y => TypeConverterExtensions.SelectToList(__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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap = (float?) content.GetValueForProperty("DataVolumeCapCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime = (int?) content.GetValueForProperty("DataVolumeCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold = (int?) content.GetValueForProperty("DataVolumeCapWarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap = (float?) content.GetValueForProperty("DataVolumeCapMaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentBillingFeatures(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentBillingFeatures(content); } @@ -196,7 +196,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.TypeConverter.cs index 8978b4c6bc06..f8c3f4e1069d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.cs similarity index 68% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.cs index b2b55374ca33..34737e8a96f4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.cs @@ -3,65 +3,65 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal { /// Backing field for property. - private string[] _currentBillingFeature; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List CurrentBillingFeature { get => this._currentBillingFeature; set => this._currentBillingFeature = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap _dataVolumeCap; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap DataVolumeCap { get => (this._dataVolumeCap = this._dataVolumeCap ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); } + public float? DataVolumeCapCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).Cap; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public float? DataVolumeCapMaxHistoryCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public int? DataVolumeCapResetTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); } + public bool? DataVolumeCapStopSendNotificationWhenHitCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitCap; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); } + public bool? DataVolumeCapStopSendNotificationWhenHitThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); } + public int? DataVolumeCapWarningThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).WarningThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal.DataVolumeCap { get => (this._dataVolumeCap = this._dataVolumeCap ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal.DataVolumeCapMaxHistoryCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).MaxHistoryCap; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).MaxHistoryCap = value ?? default(float); } /// 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; } + int? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal.DataVolumeCapResetTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).ResetTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).ResetTime = value ?? default(int); } /// /// Creates an new instance. @@ -82,14 +82,20 @@ public partial interface IApplicationInsightsComponentBillingFeatures : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + System.Collections.Generic.List CurrentBillingFeature { get; set; } /// Daily data volume cap in GB. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Daily data volume cap in GB.", SerializedName = @"Cap", PossibleTypes = new [] { typeof(float) })] @@ -98,6 +104,9 @@ public partial interface IApplicationInsightsComponentBillingFeatures : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Maximum daily data volume cap that the user can set for this component.", SerializedName = @"MaxHistoryCap", PossibleTypes = new [] { typeof(float) })] @@ -106,6 +115,9 @@ public partial interface IApplicationInsightsComponentBillingFeatures : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Daily data volume cap UTC reset hour.", SerializedName = @"ResetTime", PossibleTypes = new [] { typeof(int) })] @@ -114,6 +126,9 @@ public partial interface IApplicationInsightsComponentBillingFeatures : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Do not send a notification email when the daily data volume cap is met.", SerializedName = @"StopSendNotificationWhenHitCap", PossibleTypes = new [] { typeof(bool) })] @@ -122,6 +137,9 @@ public partial interface IApplicationInsightsComponentBillingFeatures : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reserved, not used for now.", SerializedName = @"StopSendNotificationWhenHitThreshold", PossibleTypes = new [] { typeof(bool) })] @@ -130,6 +148,9 @@ public partial interface IApplicationInsightsComponentBillingFeatures : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reserved, not used for now.", SerializedName = @"WarningThreshold", PossibleTypes = new [] { typeof(int) })] @@ -144,9 +165,9 @@ 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; } + System.Collections.Generic.List CurrentBillingFeature { get; set; } /// An Application Insights component daily data volume cap - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap DataVolumeCap { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.json.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.json.cs index 66159f60ef03..37d188d3b209 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ApplicationInsightsComponentBillingFeatures(Microsoft.Azure.PowerShell. { 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;} + {_dataVolumeCap = If( json?.PropertyT("DataVolumeCap"), out var __jsonDataVolumeCap) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.ToList(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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs similarity index 63% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs index c1aaaecacdab..c0f877b942b2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApplicationInsightsComponentDataVolumeCap partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,33 +78,33 @@ internal ApplicationInsightsComponentDataVolumeCap(global::System.Collections.ID // 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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap = (float?) content.GetValueForProperty("Cap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime = (int?) content.GetValueForProperty("ResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold = (int?) content.GetValueForProperty("WarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap = (float?) content.GetValueForProperty("MaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,55 +119,55 @@ internal ApplicationInsightsComponentDataVolumeCap(global::System.Management.Aut // 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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap = (float?) content.GetValueForProperty("Cap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime = (int?) content.GetValueForProperty("ResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold = (int?) content.GetValueForProperty("WarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap = (float?) content.GetValueForProperty("MaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentDataVolumeCap(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentDataVolumeCap(content); } @@ -180,7 +180,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.TypeConverter.cs index 75863b46b56d..85775ad55388 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.cs index a24fff7b087e..61db25433f04 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal { /// Backing field for property. @@ -28,10 +28,10 @@ public partial class ApplicationInsightsComponentDataVolumeCap : 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;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + int? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCapInternal.ResetTime { get => this._resetTime; set { {_resetTime = value;} } } /// Backing field for property. private int? _resetTime; @@ -77,6 +77,9 @@ public partial interface IApplicationInsightsComponentDataVolumeCap : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Daily data volume cap in GB.", SerializedName = @"Cap", PossibleTypes = new [] { typeof(float) })] @@ -85,6 +88,9 @@ public partial interface IApplicationInsightsComponentDataVolumeCap : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Maximum daily data volume cap that the user can set for this component.", SerializedName = @"MaxHistoryCap", PossibleTypes = new [] { typeof(float) })] @@ -93,6 +99,9 @@ public partial interface IApplicationInsightsComponentDataVolumeCap : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Daily data volume cap UTC reset hour.", SerializedName = @"ResetTime", PossibleTypes = new [] { typeof(int) })] @@ -101,6 +110,9 @@ public partial interface IApplicationInsightsComponentDataVolumeCap : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Do not send a notification email when the daily data volume cap is met.", SerializedName = @"StopSendNotificationWhenHitCap", PossibleTypes = new [] { typeof(bool) })] @@ -109,6 +121,9 @@ public partial interface IApplicationInsightsComponentDataVolumeCap : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reserved, not used for now.", SerializedName = @"StopSendNotificationWhenHitThreshold", PossibleTypes = new [] { typeof(bool) })] @@ -117,6 +132,9 @@ public partial interface IApplicationInsightsComponentDataVolumeCap : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reserved, not used for now.", SerializedName = @"WarningThreshold", PossibleTypes = new [] { typeof(int) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.json.cs index df587fca5041..d930e04bd2ac 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,23 +65,23 @@ internal ApplicationInsightsComponentDataVolumeCap(Microsoft.Azure.PowerShell.Cm { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -108,14 +108,14 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.PowerShell.cs new file mode 100644 index 000000000000..210705c1bf33 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.PowerShell.cs @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 +{ + 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.IApplicationInsightsComponentExportConfigurationInternal)this).ExportId = (string) content.GetValueForProperty("ExportId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ExportId, global::System.Convert.ToString); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("RecordType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).RecordType, global::System.Convert.ToString); + } + if (content.Contains("ApplicationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ApplicationName = (string) content.GetValueForProperty("ApplicationName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ApplicationName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageLocationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageLocationId, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationAccountId, global::System.Convert.ToString); + } + if (content.Contains("DestinationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationType, global::System.Convert.ToString); + } + if (content.Contains("IsUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).IsUserEnabled = (string) content.GetValueForProperty("IsUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).IsUserEnabled, global::System.Convert.ToString); + } + if (content.Contains("LastUserUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastUserUpdate = (string) content.GetValueForProperty("LastUserUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastUserUpdate, global::System.Convert.ToString); + } + if (content.Contains("NotificationQueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).NotificationQueueEnabled, global::System.Convert.ToString); + } + if (content.Contains("ExportStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ExportStatus = (string) content.GetValueForProperty("ExportStatus",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ExportStatus, global::System.Convert.ToString); + } + if (content.Contains("LastSuccessTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastSuccessTime = (string) content.GetValueForProperty("LastSuccessTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastSuccessTime, global::System.Convert.ToString); + } + if (content.Contains("LastGapTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastGapTime = (string) content.GetValueForProperty("LastGapTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastGapTime, global::System.Convert.ToString); + } + if (content.Contains("PermanentErrorReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).PermanentErrorReason = (string) content.GetValueForProperty("PermanentErrorReason",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).PermanentErrorReason, global::System.Convert.ToString); + } + if (content.Contains("StorageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).StorageName = (string) content.GetValueForProperty("StorageName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).StorageName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IApplicationInsightsComponentExportConfigurationInternal)this).ExportId = (string) content.GetValueForProperty("ExportId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ExportId, global::System.Convert.ToString); + } + if (content.Contains("InstrumentationKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).InstrumentationKey, global::System.Convert.ToString); + } + if (content.Contains("RecordType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).RecordType, global::System.Convert.ToString); + } + if (content.Contains("ApplicationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ApplicationName = (string) content.GetValueForProperty("ApplicationName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ApplicationName, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ResourceGroup = (string) content.GetValueForProperty("ResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageLocationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationStorageLocationId, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationAccountId, global::System.Convert.ToString); + } + if (content.Contains("DestinationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).DestinationType, global::System.Convert.ToString); + } + if (content.Contains("IsUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).IsUserEnabled = (string) content.GetValueForProperty("IsUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).IsUserEnabled, global::System.Convert.ToString); + } + if (content.Contains("LastUserUpdate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastUserUpdate = (string) content.GetValueForProperty("LastUserUpdate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastUserUpdate, global::System.Convert.ToString); + } + if (content.Contains("NotificationQueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).NotificationQueueEnabled, global::System.Convert.ToString); + } + if (content.Contains("ExportStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ExportStatus = (string) content.GetValueForProperty("ExportStatus",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ExportStatus, global::System.Convert.ToString); + } + if (content.Contains("LastSuccessTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastSuccessTime = (string) content.GetValueForProperty("LastSuccessTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastSuccessTime, global::System.Convert.ToString); + } + if (content.Contains("LastGapTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastGapTime = (string) content.GetValueForProperty("LastGapTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).LastGapTime, global::System.Convert.ToString); + } + if (content.Contains("PermanentErrorReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).PermanentErrorReason = (string) content.GetValueForProperty("PermanentErrorReason",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).PermanentErrorReason, global::System.Convert.ToString); + } + if (content.Contains("StorageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).StorageName = (string) content.GetValueForProperty("StorageName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).StorageName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.TypeConverter.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.TypeConverter.cs index d1ce6a07abc6..95b8561b4fc0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.cs similarity index 85% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.cs index 558cb00ea510..8c11d1d8f7c9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal { /// Backing field for property. @@ -114,55 +114,55 @@ public partial class ApplicationInsightsComponentExportConfiguration : 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfigurationInternal.SubscriptionId { get => this._subscriptionId; set { {_subscriptionId = value;} } } /// Backing field for property. private string _notificationQueueEnabled; @@ -227,6 +227,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the Application Insights component.", SerializedName = @"ApplicationName", PossibleTypes = new [] { typeof(string) })] @@ -235,6 +238,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the destination storage container.", SerializedName = @"ContainerName", PossibleTypes = new [] { typeof(string) })] @@ -243,6 +249,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of destination account.", SerializedName = @"DestinationAccountId", PossibleTypes = new [] { typeof(string) })] @@ -251,6 +260,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The destination account location ID.", SerializedName = @"DestinationStorageLocationId", PossibleTypes = new [] { typeof(string) })] @@ -259,6 +271,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The destination storage account subscription ID.", SerializedName = @"DestinationStorageSubscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -267,6 +282,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The destination type.", SerializedName = @"DestinationType", PossibleTypes = new [] { typeof(string) })] @@ -278,6 +296,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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) })] @@ -288,6 +309,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"This indicates current Continuous Export configuration status. The possible values are 'Preparing', 'Success', 'Failure'.", SerializedName = @"ExportStatus", PossibleTypes = new [] { typeof(string) })] @@ -296,6 +320,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The instrumentation key of the Application Insights component.", SerializedName = @"InstrumentationKey", PossibleTypes = new [] { typeof(string) })] @@ -306,6 +333,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"This will be 'true' if the Continuous Export configuration is enabled, otherwise it will be 'false'.", SerializedName = @"IsUserEnabled", PossibleTypes = new [] { typeof(string) })] @@ -314,6 +344,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last time the Continuous Export configuration started failing.", SerializedName = @"LastGapTime", PossibleTypes = new [] { typeof(string) })] @@ -324,6 +357,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last time data was successfully delivered to the destination storage container for this Continuous Export configuration.", SerializedName = @"LastSuccessTime", PossibleTypes = new [] { typeof(string) })] @@ -332,6 +368,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Last time the Continuous Export configuration was updated.", SerializedName = @"LastUserUpdate", PossibleTypes = new [] { typeof(string) })] @@ -340,6 +379,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Deprecated", SerializedName = @"NotificationQueueEnabled", PossibleTypes = new [] { typeof(string) })] @@ -350,6 +392,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"This is the reason the Continuous Export configuration started failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'.", SerializedName = @"PermanentErrorReason", PossibleTypes = new [] { typeof(string) })] @@ -361,6 +406,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -369,6 +417,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource group of the Application Insights component.", SerializedName = @"ResourceGroup", PossibleTypes = new [] { typeof(string) })] @@ -377,6 +428,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the destination storage account.", SerializedName = @"StorageName", PossibleTypes = new [] { typeof(string) })] @@ -385,6 +439,9 @@ public partial interface IApplicationInsightsComponentExportConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The subscription of the Application Insights component.", SerializedName = @"SubscriptionId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.json.cs similarity index 92% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.json.cs index ea13e5bb7414..759e5fb63aa7 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportConfiguration.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportConfiguration.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -66,36 +66,36 @@ internal ApplicationInsightsComponentExportConfiguration(Microsoft.Azure.PowerSh { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -121,73 +121,73 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.PowerShell.cs similarity index 59% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.PowerShell.cs index d7427f931b37..9ede177efca4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ApplicationInsightsComponentExportRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -80,45 +80,45 @@ internal ApplicationInsightsComponentExportRequest(global::System.Collections.ID // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress = (string) content.GetValueForProperty("DestinationAddress",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled = (string) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri = (string) content.GetValueForProperty("NotificationQueueUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,67 +133,67 @@ internal ApplicationInsightsComponentExportRequest(global::System.Management.Aut // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress = (string) content.GetValueForProperty("DestinationAddress",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled = (string) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri = (string) content.GetValueForProperty("NotificationQueueUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentExportRequest(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentExportRequest(content); } @@ -206,7 +206,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.TypeConverter.cs index 76c7dbdb2e1e..7244bc27113f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.cs index a3f848d59a3f..4475c4ec483b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150 /// 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequestInternal { /// Backing field for property. @@ -101,6 +101,9 @@ public partial interface IApplicationInsightsComponentExportRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of destination storage account.", SerializedName = @"DestinationAccountId", PossibleTypes = new [] { typeof(string) })] @@ -111,6 +114,9 @@ public partial interface IApplicationInsightsComponentExportRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The SAS URL for the destination storage container. It must grant write permission.", SerializedName = @"DestinationAddress", PossibleTypes = new [] { typeof(string) })] @@ -119,6 +125,9 @@ public partial interface IApplicationInsightsComponentExportRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The location ID of the destination storage container.", SerializedName = @"DestinationStorageLocationId", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +136,9 @@ public partial interface IApplicationInsightsComponentExportRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The subscription ID of the destination storage container.", SerializedName = @"DestinationStorageSubscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +147,9 @@ public partial interface IApplicationInsightsComponentExportRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Continuous Export destination type. This has to be 'Blob'.", SerializedName = @"DestinationType", PossibleTypes = new [] { typeof(string) })] @@ -145,6 +160,9 @@ public partial interface IApplicationInsightsComponentExportRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Set to 'true' to create a Continuous Export configuration as enabled, otherwise set it to 'false'.", SerializedName = @"IsEnabled", PossibleTypes = new [] { typeof(string) })] @@ -153,6 +171,9 @@ public partial interface IApplicationInsightsComponentExportRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Deprecated", SerializedName = @"NotificationQueueEnabled", PossibleTypes = new [] { typeof(string) })] @@ -161,6 +182,9 @@ public partial interface IApplicationInsightsComponentExportRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Deprecated", SerializedName = @"NotificationQueueUri", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +196,9 @@ public partial interface IApplicationInsightsComponentExportRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.json.cs index 0e2c805039e8..19ee1f5a5c85 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -67,26 +67,26 @@ internal ApplicationInsightsComponentExportRequest(Microsoft.Azure.PowerShell.Cm { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.PowerShell.cs similarity index 57% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.PowerShell.cs index 44eb3eba0043..9fe2e25ea354 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApplicationInsightsComponentFeature partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,45 +78,45 @@ internal ApplicationInsightsComponentFeature(global::System.Collections.IDiction // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).FeatureName = (string) content.GetValueForProperty("FeatureName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).ResouceId = (string) content.GetValueForProperty("ResouceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).IsHidden = (bool?) content.GetValueForProperty("IsHidden",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).Capability = (System.Collections.Generic.List) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).Capability, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature = (bool?) content.GetValueForProperty("IsMainFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature = (string) content.GetValueForProperty("SupportedAddonFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,67 +131,67 @@ internal ApplicationInsightsComponentFeature(global::System.Management.Automatio // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).FeatureName = (string) content.GetValueForProperty("FeatureName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).ResouceId = (string) content.GetValueForProperty("ResouceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).IsHidden = (bool?) content.GetValueForProperty("IsHidden",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).Capability = (System.Collections.Generic.List) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).Capability, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature = (bool?) content.GetValueForProperty("IsMainFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature = (string) content.GetValueForProperty("SupportedAddonFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentFeature(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentFeature(content); } @@ -203,7 +203,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.TypeConverter.cs index b693137bcecc..6948931f22bc 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.cs similarity index 78% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.cs index e6259eb61e80..c41e19eb51ae 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.cs @@ -3,22 +3,22 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[] _capability; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List Capability { get => this._capability; } /// Backing field for property. private string _featureName; @@ -56,31 +56,31 @@ public partial class ApplicationInsightsComponentFeature : 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;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureInternal.Title { get => this._title; set { {_title = value;} } } /// Backing field for property. private string _resouceId; @@ -117,14 +117,20 @@ public partial interface IApplicationInsightsComponentFeature : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability) })] + System.Collections.Generic.List Capability { get; } /// The pricing feature name. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The pricing feature name.", SerializedName = @"FeatureName", PossibleTypes = new [] { typeof(string) })] @@ -133,6 +139,9 @@ public partial interface IApplicationInsightsComponentFeature : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"IsHidden", PossibleTypes = new [] { typeof(bool) })] @@ -141,6 +150,9 @@ public partial interface IApplicationInsightsComponentFeature : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether can apply addon feature on to it.", SerializedName = @"IsMainFeature", PossibleTypes = new [] { typeof(bool) })] @@ -149,6 +161,9 @@ public partial interface IApplicationInsightsComponentFeature : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The meter id used for the feature.", SerializedName = @"MeterId", PossibleTypes = new [] { typeof(string) })] @@ -157,6 +172,9 @@ public partial interface IApplicationInsightsComponentFeature : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The meter rate for the feature's meter.", SerializedName = @"MeterRateFrequency", PossibleTypes = new [] { typeof(string) })] @@ -165,6 +183,9 @@ public partial interface IApplicationInsightsComponentFeature : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"ResouceId", PossibleTypes = new [] { typeof(string) })] @@ -173,6 +194,9 @@ public partial interface IApplicationInsightsComponentFeature : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The add on features on main feature.", SerializedName = @"SupportedAddonFeatures", PossibleTypes = new [] { typeof(string) })] @@ -181,6 +205,9 @@ public partial interface IApplicationInsightsComponentFeature : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the feature.", SerializedName = @"Title", PossibleTypes = new [] { typeof(string) })] @@ -192,7 +219,7 @@ internal partial interface IApplicationInsightsComponentFeatureInternal { /// A list of Application Insights component feature capability. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[] Capability { get; set; } + System.Collections.Generic.List Capability { get; set; } /// The pricing feature name. string FeatureName { get; set; } /// Reserved, not used now. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.json.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.json.cs index 33dec21a83f3..233df20287ae 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,26 +65,26 @@ internal ApplicationInsightsComponentFeature(Microsoft.Azure.PowerShell.Cmdlets. { 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;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -109,27 +109,27 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { if (null != this._capability) { @@ -141,15 +141,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN container.Add("Capabilities",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.PowerShell.cs new file mode 100644 index 000000000000..57d8752d6fc7 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.PowerShell.cs @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 +{ + 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.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).SupportExportData = (bool?) content.GetValueForProperty("SupportExportData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).SupportExportData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BurstThrottlePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).BurstThrottlePolicy = (string) content.GetValueForProperty("BurstThrottlePolicy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).BurstThrottlePolicy, global::System.Convert.ToString); + } + if (content.Contains("MetadataClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MetadataClass = (string) content.GetValueForProperty("MetadataClass",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MetadataClass, global::System.Convert.ToString); + } + if (content.Contains("LiveStreamMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).LiveStreamMetric = (bool?) content.GetValueForProperty("LiveStreamMetric",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).LiveStreamMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApplicationMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApplicationMap = (bool?) content.GetValueForProperty("ApplicationMap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApplicationMap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkItemIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).WorkItemIntegration = (bool?) content.GetValueForProperty("WorkItemIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).WorkItemIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PowerBiIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).PowerBiIntegration = (bool?) content.GetValueForProperty("PowerBiIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).PowerBiIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).OpenSchema = (bool?) content.GetValueForProperty("OpenSchema",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).OpenSchema, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProactiveDetection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ProactiveDetection = (bool?) content.GetValueForProperty("ProactiveDetection",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ProactiveDetection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AnalyticsIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).AnalyticsIntegration = (bool?) content.GetValueForProperty("AnalyticsIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).AnalyticsIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MultipleStepWebTest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MultipleStepWebTest = (bool?) content.GetValueForProperty("MultipleStepWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MultipleStepWebTest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiAccessLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApiAccessLevel = (string) content.GetValueForProperty("ApiAccessLevel",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApiAccessLevel, global::System.Convert.ToString); + } + if (content.Contains("TrackingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).TrackingType = (string) content.GetValueForProperty("TrackingType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).TrackingType, global::System.Convert.ToString); + } + if (content.Contains("DailyCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCap = (float?) content.GetValueForProperty("DailyCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DailyCapResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCapResetTime = (float?) content.GetValueForProperty("DailyCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCapResetTime, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ThrottleRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ThrottleRate = (float?) content.GetValueForProperty("ThrottleRate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).SupportExportData = (bool?) content.GetValueForProperty("SupportExportData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).SupportExportData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BurstThrottlePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).BurstThrottlePolicy = (string) content.GetValueForProperty("BurstThrottlePolicy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).BurstThrottlePolicy, global::System.Convert.ToString); + } + if (content.Contains("MetadataClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MetadataClass = (string) content.GetValueForProperty("MetadataClass",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MetadataClass, global::System.Convert.ToString); + } + if (content.Contains("LiveStreamMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).LiveStreamMetric = (bool?) content.GetValueForProperty("LiveStreamMetric",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).LiveStreamMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApplicationMap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApplicationMap = (bool?) content.GetValueForProperty("ApplicationMap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApplicationMap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WorkItemIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).WorkItemIntegration = (bool?) content.GetValueForProperty("WorkItemIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).WorkItemIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PowerBiIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).PowerBiIntegration = (bool?) content.GetValueForProperty("PowerBiIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).PowerBiIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenSchema")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).OpenSchema = (bool?) content.GetValueForProperty("OpenSchema",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).OpenSchema, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProactiveDetection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ProactiveDetection = (bool?) content.GetValueForProperty("ProactiveDetection",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ProactiveDetection, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AnalyticsIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).AnalyticsIntegration = (bool?) content.GetValueForProperty("AnalyticsIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).AnalyticsIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MultipleStepWebTest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MultipleStepWebTest = (bool?) content.GetValueForProperty("MultipleStepWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).MultipleStepWebTest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiAccessLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApiAccessLevel = (string) content.GetValueForProperty("ApiAccessLevel",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ApiAccessLevel, global::System.Convert.ToString); + } + if (content.Contains("TrackingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).TrackingType = (string) content.GetValueForProperty("TrackingType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).TrackingType, global::System.Convert.ToString); + } + if (content.Contains("DailyCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCap = (float?) content.GetValueForProperty("DailyCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DailyCapResetTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCapResetTime = (float?) content.GetValueForProperty("DailyCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).DailyCapResetTime, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ThrottleRate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal)this).ThrottleRate = (float?) content.GetValueForProperty("ThrottleRate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.TypeConverter.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.TypeConverter.cs index 3a990e76f335..04cb9d41d20b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.cs similarity index 82% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.cs index 89c1409d157b..fec769cf0cc1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal { /// Backing field for property. @@ -70,52 +70,52 @@ public partial class ApplicationInsightsComponentFeatureCapabilities : 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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilitiesInternal.WorkItemIntegration { get => this._workItemIntegration; set { {_workItemIntegration = value;} } } /// Backing field for property. private bool? _multipleStepWebTest; @@ -189,6 +189,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"AnalyticsIntegration", PossibleTypes = new [] { typeof(bool) })] @@ -197,6 +200,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"ApiAccessLevel", PossibleTypes = new [] { typeof(string) })] @@ -205,6 +211,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"ApplicationMap", PossibleTypes = new [] { typeof(bool) })] @@ -213,6 +222,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"BurstThrottlePolicy", PossibleTypes = new [] { typeof(string) })] @@ -221,6 +233,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Daily data volume cap in GB.", SerializedName = @"DailyCap", PossibleTypes = new [] { typeof(float) })] @@ -229,6 +244,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Daily data volume cap UTC reset hour.", SerializedName = @"DailyCapResetTime", PossibleTypes = new [] { typeof(float) })] @@ -237,6 +255,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"LiveStreamMetrics", PossibleTypes = new [] { typeof(bool) })] @@ -245,6 +266,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"MetadataClass", PossibleTypes = new [] { typeof(string) })] @@ -253,6 +277,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether allow to use multiple steps web test feature.", SerializedName = @"MultipleStepWebTest", PossibleTypes = new [] { typeof(bool) })] @@ -261,6 +288,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"OpenSchema", PossibleTypes = new [] { typeof(bool) })] @@ -269,6 +299,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"PowerBIIntegration", PossibleTypes = new [] { typeof(bool) })] @@ -277,6 +310,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"ProactiveDetection", PossibleTypes = new [] { typeof(bool) })] @@ -285,6 +321,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether allow to use continuous export feature.", SerializedName = @"SupportExportData", PossibleTypes = new [] { typeof(bool) })] @@ -293,6 +332,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Reserved, not used now.", SerializedName = @"ThrottleRate", PossibleTypes = new [] { typeof(float) })] @@ -301,6 +343,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The application insights component used tracking type.", SerializedName = @"TrackingType", PossibleTypes = new [] { typeof(string) })] @@ -309,6 +354,9 @@ public partial interface IApplicationInsightsComponentFeatureCapabilities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether allow to use work item integration feature.", SerializedName = @"WorkItemIntegration", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.json.cs similarity index 92% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.json.cs index 4dd9cd25ebb9..2164ba869b4f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapabilities.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapabilities.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -66,33 +66,33 @@ internal ApplicationInsightsComponentFeatureCapabilities(Microsoft.Azure.PowerSh { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -118,67 +118,67 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.PowerShell.cs similarity index 65% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.PowerShell.cs index 4f3efbfcd665..db1874530bae 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApplicationInsightsComponentFeatureCapability partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,33 +78,33 @@ internal ApplicationInsightsComponentFeatureCapability(global::System.Collection // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,55 +119,55 @@ internal ApplicationInsightsComponentFeatureCapability(global::System.Management // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentFeatureCapability(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentFeatureCapability(content); } @@ -180,7 +180,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.TypeConverter.cs index 61c677258b5b..209d75bd7511 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.cs similarity index 84% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.cs index 3a013f5bc74e..d673a3385d44 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal { /// Backing field for property. @@ -35,22 +35,22 @@ public partial class ApplicationInsightsComponentFeatureCapability : 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilityInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _name; @@ -89,6 +89,9 @@ public partial interface IApplicationInsightsComponentFeatureCapability : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The description of the capability.", SerializedName = @"Description", PossibleTypes = new [] { typeof(string) })] @@ -97,6 +100,9 @@ public partial interface IApplicationInsightsComponentFeatureCapability : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The meter used for the capability.", SerializedName = @"MeterId", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +111,9 @@ public partial interface IApplicationInsightsComponentFeatureCapability : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The meter rate of the meter.", SerializedName = @"MeterRateFrequency", PossibleTypes = new [] { typeof(string) })] @@ -113,6 +122,9 @@ public partial interface IApplicationInsightsComponentFeatureCapability : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the capability.", SerializedName = @"Name", PossibleTypes = new [] { typeof(string) })] @@ -121,6 +133,9 @@ public partial interface IApplicationInsightsComponentFeatureCapability : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The unit of the capability.", SerializedName = @"Unit", PossibleTypes = new [] { typeof(string) })] @@ -129,6 +144,9 @@ public partial interface IApplicationInsightsComponentFeatureCapability : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The value of the capability.", SerializedName = @"Value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.json.cs index 4f3907a10202..998e2c941a52 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -66,23 +66,23 @@ internal ApplicationInsightsComponentFeatureCapability(Microsoft.Azure.PowerShel { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -108,27 +108,27 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.PowerShell.cs similarity index 74% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.PowerShell.cs index e5eb02c22be1..f2ceee7ec6a6 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApplicationInsightsComponentListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal ApplicationInsightsComponentListResult(global::System.Collections.IDict // 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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,39 @@ internal ApplicationInsightsComponentListResult(global::System.Management.Automa // 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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentListResult(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentListResult(content); } @@ -148,7 +148,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.TypeConverter.cs index 2bec9b455ddc..1e2443fd341d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.cs similarity index 78% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.cs index cb5cc7997c59..679f51172da8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResultInternal { /// Backing field for property. @@ -24,11 +24,11 @@ public partial class ApplicationInsightsComponentListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[] _value; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ApplicationInsightsComponentListResult() @@ -47,6 +47,9 @@ public partial interface IApplicationInsightsComponentListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -55,10 +58,13 @@ public partial interface IApplicationInsightsComponentListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent) })] + System.Collections.Generic.List Value { get; set; } } /// Describes the list of Application Insights Resources. @@ -71,7 +77,7 @@ internal partial interface IApplicationInsightsComponentListResultInternal /// string NextLink { get; set; } /// List of Application Insights component definitions. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.json.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.json.cs index cdceaf60ff88..3ca3c4835978 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ApplicationInsightsComponentListResult(Microsoft.Azure.PowerShell.Cmdle { 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;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.PowerShell.cs similarity index 50% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.PowerShell.cs index f70785b705c8..1f6a93516214 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.PowerShell.cs @@ -3,13 +3,13 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - /// An Application Insights component definition. - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentTypeConverter))] - public partial class ApplicationInsightsComponent + /// Properties that define an Application Insights component resource. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentPropertiesTypeConverter))] + public partial class ApplicationInsightsComponentProperties { /// @@ -63,11 +63,11 @@ public partial class ApplicationInsightsComponent partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponent(global::System.Collections.IDictionary content) + internal ApplicationInsightsComponentProperties(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -76,147 +76,115 @@ internal ApplicationInsightsComponent(global::System.Collections.IDictionary con 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")) + if (content.Contains("ApplicationId")) { - ((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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); } - if (content.Contains("Id")) + if (content.Contains("AppId")) { - ((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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).AppId, 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).Name, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationType = (string) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationType, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).FlowType = (string) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).FlowType, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).RequestSource = (string) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).RequestSource, 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IApplicationInsightsComponentInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PrivateLinkScopedResource = (System.Collections.Generic.List) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForIngestion = (string) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForIngestion, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForQuery = (string) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForQuery, global::System.Convert.ToString); + } + if (content.Contains("IngestionMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).IngestionMode = (string) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).IngestionMode, global::System.Convert.ToString); } 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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ForceCustomerStorageForProfiler, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponent(global::System.Management.Automation.PSObject content) + internal ApplicationInsightsComponentProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -225,175 +193,146 @@ internal ApplicationInsightsComponent(global::System.Management.Automation.PSObj 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")) + if (content.Contains("ApplicationId")) { - ((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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); } - if (content.Contains("Id")) + if (content.Contains("AppId")) { - ((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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).AppId, 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).Name, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationType = (string) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationType, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).FlowType = (string) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).FlowType, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).RequestSource = (string) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).RequestSource, 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IApplicationInsightsComponentInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PrivateLinkScopedResource = (System.Collections.Generic.List) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForIngestion = (string) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForIngestion, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForQuery = (string) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).PublicNetworkAccessForQuery, global::System.Convert.ToString); + } + if (content.Contains("IngestionMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).IngestionMode = (string) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).IngestionMode, global::System.Convert.ToString); } 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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ForceCustomerStorageForProfiler, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new ApplicationInsightsComponent(content); + return new ApplicationInsightsComponentProperties(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new ApplicationInsightsComponent(content); + return new ApplicationInsightsComponentProperties(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// 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)); + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -412,9 +351,9 @@ public override string ToString() return ToJsonString(); } } - /// An Application Insights component definition. - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentTypeConverter))] - public partial interface IApplicationInsightsComponent + /// Properties that define an Application Insights component resource. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentPropertiesTypeConverter))] + public partial interface IApplicationInsightsComponentProperties { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.TypeConverter.cs index 7c9865aa48b0..193fc3eb0488 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.cs similarity index 77% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.cs index beddade7d4cc..3f0194dccbd5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal { /// Backing field for property. @@ -30,11 +30,11 @@ public partial class ApplicationInsightsComponentProperties : public string ApplicationId { get => this._applicationId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType _applicationType; + private string _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; } + public string ApplicationType { get => this._applicationType; set => this._applicationType = value; } /// Backing field for property. private string _connectionString; @@ -65,14 +65,14 @@ public partial class ApplicationInsightsComponentProperties : public bool? DisableLocalAuth { get => this._disableLocalAuth; set => this._disableLocalAuth = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? _flowType; + private string _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; } + public string FlowType { get => this._flowType; set => this._flowType = value; } /// Backing field for property. private bool? _forceCustomerStorageForProfiler; @@ -86,6 +86,7 @@ public partial class ApplicationInsightsComponentProperties : /// /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// Please visit external url https://aka.ms/ewjuel to get more information. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] public string HockeyAppId { get => this._hockeyAppId; set => this._hockeyAppId = value; } @@ -94,7 +95,8 @@ public partial class ApplicationInsightsComponentProperties : private string _hockeyAppToken; /// - /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// Token used to authenticate communications with between Application Insights and HockeyApp. Please visit external url https://aka.ms/sls76s + /// to get more information. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] public string HockeyAppToken { get => this._hockeyAppToken; } @@ -107,11 +109,11 @@ public partial class ApplicationInsightsComponentProperties : public bool? ImmediatePurgeDataOn30Day { get => this._immediatePurgeDataOn30Day; set => this._immediatePurgeDataOn30Day = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? _ingestionMode; + private string _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; } + public string IngestionMode { get => this._ingestionMode; set => this._ingestionMode = value; } /// Backing field for property. private string _instrumentationKey; @@ -132,37 +134,37 @@ public partial class ApplicationInsightsComponentProperties : 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } /// Backing field for property. private string _name; @@ -172,11 +174,11 @@ public partial class ApplicationInsightsComponentProperties : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] _privateLinkScopedResource; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List PrivateLinkScopedResource { get => this._privateLinkScopedResource; } /// Backing field for property. private string _provisioningState; @@ -189,28 +191,28 @@ public partial class ApplicationInsightsComponentProperties : public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? _publicNetworkAccessForIngestion; + private string _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; } + public string PublicNetworkAccessForIngestion { get => this._publicNetworkAccessForIngestion; set => this._publicNetworkAccessForIngestion = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? _publicNetworkAccessForQuery; + private string _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; } + public string PublicNetworkAccessForQuery { get => this._publicNetworkAccessForQuery; set => this._publicNetworkAccessForQuery = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? _requestSource; + private string _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; } + public string RequestSource { get => this._requestSource; set => this._requestSource = value; } /// Backing field for property. private int? _retentionInDay; @@ -224,6 +226,7 @@ public partial class ApplicationInsightsComponentProperties : /// /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// Please visit external url https://aka.ms/sl0yqd to get more information. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] public double? SamplingPercentage { get => this._samplingPercentage; set => this._samplingPercentage = value; } @@ -259,6 +262,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Application Insights Unique ID for your Application.", SerializedName = @"AppId", PossibleTypes = new [] { typeof(string) })] @@ -269,22 +275,32 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] + string ApplicationType { get; set; } /// Application Insights component connection string. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Application Insights component connection string.", SerializedName = @"ConnectionString", PossibleTypes = new [] { typeof(string) })] @@ -293,6 +309,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Creation Date for the Application Insights component, in ISO 8601 format.", SerializedName = @"CreationDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -301,6 +320,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Disable IP masking.", SerializedName = @"DisableIpMasking", PossibleTypes = new [] { typeof(bool) })] @@ -309,6 +331,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Disable Non-AAD based Auth.", SerializedName = @"DisableLocalAuth", PossibleTypes = new [] { typeof(bool) })] @@ -320,35 +345,50 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] + string 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, + Read = true, + Create = true, + Update = true, 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. + /// Please visit external url https://aka.ms/ewjuel to get more information. /// [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.", + Read = true, + Create = true, + Update = true, + Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. Please visit external url https://aka.ms/ewjuel to get more information.", SerializedName = @"HockeyAppId", PossibleTypes = new [] { typeof(string) })] string HockeyAppId { get; set; } /// - /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// Token used to authenticate communications with between Application Insights and HockeyApp. Please visit external url https://aka.ms/sls76s + /// to get more information. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, - Description = @"Token used to authenticate communications with between Application Insights and HockeyApp.", + Read = true, + Create = false, + Update = false, + Description = @"Token used to authenticate communications with between Application Insights and HockeyApp. Please visit external url https://aka.ms/sls76s to get more information.", SerializedName = @"HockeyAppToken", PossibleTypes = new [] { typeof(string) })] string HockeyAppToken { get; } @@ -356,6 +396,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Purge data immediately after 30 days.", SerializedName = @"ImmediatePurgeDataOn30Days", PossibleTypes = new [] { typeof(bool) })] @@ -364,10 +407,14 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] + string 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 @@ -376,6 +423,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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) })] @@ -384,6 +434,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The date which the component got migrated to LA, in ISO 8601 format.", SerializedName = @"LaMigrationDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -392,6 +445,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Application name.", SerializedName = @"Name", PossibleTypes = new [] { typeof(string) })] @@ -400,10 +456,13 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource) })] + System.Collections.Generic.List 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. @@ -411,6 +470,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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) })] @@ -419,18 +481,26 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccessForIngestion { get; set; } /// The network access type for accessing Application Insights query. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccessForQuery { get; set; } /// /// Describes what tool created this Application Insights component. Customers using this API should set this to the default /// 'rest'. @@ -438,25 +508,36 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] + string RequestSource { get; set; } /// Retention period in days. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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. + /// Please visit external url https://aka.ms/sl0yqd to get more information. /// [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.", + Read = true, + Create = true, + Update = true, + Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. Please visit external url https://aka.ms/sl0yqd to get more information.", SerializedName = @"SamplingPercentage", PossibleTypes = new [] { typeof(double) })] double? SamplingPercentage { get; set; } @@ -464,6 +545,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure Tenant Id.", SerializedName = @"TenantId", PossibleTypes = new [] { typeof(string) })] @@ -475,6 +559,9 @@ public partial interface IApplicationInsightsComponentProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -492,7 +579,8 @@ internal partial interface IApplicationInsightsComponentPropertiesInternal /// string ApplicationId { get; set; } /// Type of application being monitored. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType ApplicationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] + string ApplicationType { get; set; } /// Application Insights component connection string. string ConnectionString { get; set; } /// Creation Date for the Application Insights component, in ISO 8601 format. @@ -505,21 +593,25 @@ internal partial interface IApplicationInsightsComponentPropertiesInternal /// 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; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] + string 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. + /// Please visit external url https://aka.ms/ewjuel to get more information. /// string HockeyAppId { get; set; } /// - /// Token used to authenticate communications with between Application Insights and HockeyApp. + /// Token used to authenticate communications with between Application Insights and HockeyApp. Please visit external url https://aka.ms/sls76s + /// to get more information. /// 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; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] + string 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 @@ -531,25 +623,29 @@ internal partial interface IApplicationInsightsComponentPropertiesInternal /// Application name. string Name { get; set; } /// List of linked private link scope resources. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get; set; } + System.Collections.Generic.List 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; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccessForIngestion { get; set; } /// The network access type for accessing Application Insights query. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string 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; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] + string 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. + /// Please visit external url https://aka.ms/sl0yqd to get more information. /// double? SamplingPercentage { get; set; } /// Azure Tenant Id. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.json.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.json.cs index 814c4f48b32b..a9a4b443a428 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentProperties.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,42 +65,42 @@ internal ApplicationInsightsComponentProperties(Microsoft.Azure.PowerShell.Cmdle { 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;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -125,44 +125,47 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate)) + { + 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } @@ -170,11 +173,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { if (null != this._privateLinkScopedResource) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.PowerShell.cs similarity index 73% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.PowerShell.cs index 0125c98a1577..e9d9b5f58b1c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ApplicationInsightsComponentQuotaStatus partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal ApplicationInsightsComponentQuotaStatus(global::System.Collections.IDic // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled = (bool?) content.GetValueForProperty("ShouldBeThrottled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime = (string) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,43 +107,43 @@ internal ApplicationInsightsComponentQuotaStatus(global::System.Management.Autom // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled = (bool?) content.GetValueForProperty("ShouldBeThrottled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime = (string) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApplicationInsightsComponentQuotaStatus(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApplicationInsightsComponentQuotaStatus(content); } @@ -156,7 +156,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.TypeConverter.cs index bc94b2097598..9d992298385f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.cs similarity index 87% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.cs index eb2150cf43f5..c310bdd628b1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal { /// Backing field for property. @@ -30,13 +30,13 @@ public partial class ApplicationInsightsComponentQuotaStatus : 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatusInternal.ShouldBeThrottled { get => this._shouldBeThrottled; set { {_shouldBeThrottled = value;} } } /// Backing field for property. private bool? _shouldBeThrottled; @@ -59,6 +59,9 @@ public partial interface IApplicationInsightsComponentQuotaStatus : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Application ID for the Application Insights component.", SerializedName = @"AppId", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +72,9 @@ public partial interface IApplicationInsightsComponentQuotaStatus : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date and time when the daily data volume cap will be reset, and data ingestion will resume.", SerializedName = @"ExpirationTime", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +83,9 @@ public partial interface IApplicationInsightsComponentQuotaStatus : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The daily data volume cap is met, and data ingestion will be stopped.", SerializedName = @"ShouldBeThrottled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.json.cs index 474d76648b81..66732eba6be0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ApplicationInsightsComponentQuotaStatus(Microsoft.Azure.PowerShell.Cmdl { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.PowerShell.cs index e657c9cf86a6..4bdd64ba0d45 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.PowerShell.cs @@ -75,14 +75,14 @@ internal ApplicationInsightsIdentity(global::System.Collections.IDictionary cont return; } // actually deserialize - if (content.Contains("ResourceGroupName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); - } if (content.Contains("SubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } if (content.Contains("WebTestName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).WebTestName, global::System.Convert.ToString); @@ -113,7 +113,7 @@ internal ApplicationInsightsIdentity(global::System.Collections.IDictionary cont } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).StorageType = (string) content.GetValueForProperty("StorageType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).StorageType, global::System.Convert.ToString); } if (content.Contains("RevisionId")) { @@ -140,14 +140,14 @@ internal ApplicationInsightsIdentity(global::System.Management.Automation.PSObje return; } // actually deserialize - if (content.Contains("ResourceGroupName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); - } if (content.Contains("SubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } if (content.Contains("WebTestName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).WebTestName, global::System.Convert.ToString); @@ -178,7 +178,7 @@ internal ApplicationInsightsIdentity(global::System.Management.Automation.PSObje } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).StorageType = (string) content.GetValueForProperty("StorageType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentityInternal)this).StorageType, global::System.Convert.ToString); } if (content.Contains("RevisionId")) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.cs index 5d3d55129810..7f2c71696e16 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.cs @@ -82,13 +82,13 @@ public partial class ApplicationInsightsIdentity : public string RevisionId { get => this._revisionId; set => this._revisionId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType? _storageType; + private string _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; } + public string StorageType { get => this._storageType; set => this._storageType = value; } /// Backing field for property. private string _subscriptionId; @@ -119,6 +119,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The unique annotation ID. This is unique within a Application Insights component.", SerializedName = @"annotationId", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +130,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Application Insights component resource.", SerializedName = @"componentName", PossibleTypes = new [] { typeof(string) })] @@ -137,6 +143,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Continuous Export configuration ID. This is unique within a Application Insights component.", SerializedName = @"exportId", PossibleTypes = new [] { typeof(string) })] @@ -145,6 +154,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -153,6 +165,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The API Key ID. This is unique within a Application Insights component.", SerializedName = @"keyId", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +178,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -171,6 +189,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the resource group. The name is case insensitive.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -179,6 +200,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Application Insights component resource.", SerializedName = @"resourceName", PossibleTypes = new [] { typeof(string) })] @@ -187,6 +211,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of the workbook's revision.", SerializedName = @"revisionId", PossibleTypes = new [] { typeof(string) })] @@ -197,14 +224,21 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ServiceProfiler")] + string StorageType { get; set; } /// The ID of the target subscription. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the target subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -213,6 +247,9 @@ public partial interface IApplicationInsightsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Application Insights WebTest resource.", SerializedName = @"webTestName", PossibleTypes = new [] { typeof(string) })] @@ -249,7 +286,8 @@ internal partial interface IApplicationInsightsIdentityInternal /// /// The type of the Application Insights component data source for the linked storage account. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.StorageType? StorageType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ServiceProfiler")] + string StorageType { get; set; } /// The ID of the target subscription. string SubscriptionId { get; set; } /// The name of the Application Insights WebTest resource. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.json.cs index 9c6b4c84bc4f..6ebfe9ff025a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsIdentity.json.cs @@ -64,18 +64,18 @@ internal ApplicationInsightsIdentity(Microsoft.Azure.PowerShell.Cmdlets.Applicat { return; } - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_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;} - {_revisionId = If( json?.PropertyT("revisionId"), out var __jsonRevisionId) ? (string)__jsonRevisionId : (string)RevisionId;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)_resourceGroupName;} + {_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;} + {_revisionId = If( json?.PropertyT("revisionId"), out var __jsonRevisionId) ? (string)__jsonRevisionId : (string)_revisionId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } @@ -110,8 +110,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); 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._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,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 ); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.PowerShell.cs similarity index 68% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.PowerShell.cs index 7ac9d07adadf..5a4e27f22a70 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ComponentLinkedStorageAccounts partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,29 +78,29 @@ internal ComponentLinkedStorageAccounts(global::System.Collections.IDictionary c // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -115,51 +115,51 @@ internal ComponentLinkedStorageAccounts(global::System.Management.Automation.PSO // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ComponentLinkedStorageAccounts(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ComponentLinkedStorageAccounts(content); } @@ -169,7 +169,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.TypeConverter.cs index 4fcb1810d694..68993eec3427 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.cs similarity index 68% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.cs index b4c08a5ab14d..874128963918 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.cs @@ -3,54 +3,54 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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.Models.IComponentLinkedStorageAccounts, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ProxyResource(); /// /// 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; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).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; } + public string LinkedStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.LinkedStorageAccountsProperties()); set { {_property = value;} } } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).Id = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).Name = value ?? null; } /// 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).Type = value ?? null; } /// 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; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.LinkedStorageAccountsProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] @@ -60,7 +60,7 @@ public partial class ComponentLinkedStorageAccounts : /// 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; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).Type; } /// Creates an new instance. public ComponentLinkedStorageAccounts() @@ -76,19 +76,22 @@ public ComponentLinkedStorageAccounts() /// 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); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } } /// 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IProxyResource { /// Linked storage account resource ID [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Linked storage account resource ID", SerializedName = @"linkedStorageAccount", PossibleTypes = new [] { typeof(string) })] @@ -97,12 +100,12 @@ public partial interface IComponentLinkedStorageAccounts : } /// An Application Insights component linked storage accounts internal partial interface IComponentLinkedStorageAccountsInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IProxyResourceInternal { /// 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; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.json.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.json.cs index 7fef7038b01e..c9b6220adc3d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ComponentLinkedStorageAccounts(Microsoft.Azure.PowerShell.Cmdlets.Appli { 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;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.LinkedStorageAccountsProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.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; diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.PowerShell.cs similarity index 74% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.PowerShell.cs index f245fb4f0ea0..e74cdf1bd422 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ComponentLinkedStorageAccountsPatch partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal ComponentLinkedStorageAccountsPatch(global::System.Collections.IDiction // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,39 @@ internal ComponentLinkedStorageAccountsPatch(global::System.Management.Automatio // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ComponentLinkedStorageAccountsPatch(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ComponentLinkedStorageAccountsPatch(content); } @@ -147,7 +147,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.TypeConverter.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.TypeConverter.cs index 1173953cf2ba..ad04b319b07f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.cs similarity index 68% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.cs index e497575ea07b..fd9c08fcfc23 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.cs @@ -3,29 +3,29 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string LinkedStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.LinkedStorageAccountsProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.LinkedStorageAccountsProperties()); set => this._property = value; } /// Creates an new instance. public ComponentLinkedStorageAccountsPatch() @@ -41,6 +41,9 @@ public partial interface IComponentLinkedStorageAccountsPatch : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Linked storage account resource ID", SerializedName = @"linkedStorageAccount", PossibleTypes = new [] { typeof(string) })] @@ -54,7 +57,7 @@ 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; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties Property { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.json.cs index cd87caf7305c..3e29b58d69f2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ComponentLinkedStorageAccountsPatch(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.LinkedStorageAccountsProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.PowerShell.cs similarity index 75% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.PowerShell.cs index bb6f09725b3a..a4d503b65025 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ComponentPurgeBody partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal ComponentPurgeBody(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyInternal)this).Filter = (System.Collections.Generic.List) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyInternal)this).Filter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeBodyFiltersTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,37 @@ internal ComponentPurgeBody(global::System.Management.Automation.PSObject conten // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyInternal)this).Filter = (System.Collections.Generic.List) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyInternal)this).Filter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeBodyFiltersTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ComponentPurgeBody(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ComponentPurgeBody(content); } @@ -145,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.TypeConverter.cs index c85172a5dd0b..d72f1e39a287 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.cs similarity index 77% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.cs index 8c50e31cee8d..55acbd425e30 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.cs @@ -3,24 +3,24 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters[] _filter; + private System.Collections.Generic.List _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; } + public System.Collections.Generic.List Filter { get => this._filter; set => this._filter = value; } /// Backing field for property. private string _table; @@ -45,14 +45,20 @@ public partial interface IComponentPurgeBody : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters) })] + System.Collections.Generic.List Filter { get; set; } /// Table from which to purge data. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Table from which to purge data.", SerializedName = @"table", PossibleTypes = new [] { typeof(string) })] @@ -66,7 +72,7 @@ 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; } + System.Collections.Generic.List Filter { get; set; } /// Table from which to purge data. string Table { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.json.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.json.cs index ab5dcee41936..8ef158d4a687 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBody.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBody.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ComponentPurgeBody(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsigh { 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;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeBodyFilters.FromJson(__u) )) ))() : null : _filter;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.PowerShell.cs similarity index 72% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.PowerShell.cs index 2f61f9305f4e..0b1875d0eef5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ComponentPurgeBodyFilters partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,25 +78,25 @@ internal ComponentPurgeBodyFilters(global::System.Collections.IDictionary conten // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Column = (string) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Key, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -111,47 +111,45 @@ internal ComponentPurgeBodyFilters(global::System.Management.Automation.PSObject // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Column = (string) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal)this).Key, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ComponentPurgeBodyFilters(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ComponentPurgeBodyFilters(content); } @@ -161,7 +159,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.TypeConverter.cs index f0bbe72fca4b..e5be02af38b8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.cs index 4e8546e7d76a..92bb7efc833c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFiltersInternal { /// Backing field for property. @@ -63,6 +63,9 @@ public partial interface IComponentPurgeBodyFilters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The column of the table over which the given query should run", SerializedName = @"column", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +76,9 @@ public partial interface IComponentPurgeBodyFilters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"When filtering over custom dimensions, this key will be used as the name of the custom dimension.", SerializedName = @"key", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +90,9 @@ public partial interface IComponentPurgeBodyFilters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -95,6 +104,9 @@ public partial interface IComponentPurgeBodyFilters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.json.cs index c99669e42393..1af952adfc82 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ComponentPurgeBodyFilters(Microsoft.Azure.PowerShell.Cmdlets.Applicatio { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.PowerShell.cs similarity index 83% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.PowerShell.cs index e85153ba35c9..f35025774da4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ComponentPurgeResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,13 +78,13 @@ internal ComponentPurgeResponse(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponseInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponseInternal)this).OperationId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,33 @@ internal ComponentPurgeResponse(global::System.Management.Automation.PSObject co // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponseInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponseInternal)this).OperationId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ComponentPurgeResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ComponentPurgeResponse(content); } @@ -137,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.TypeConverter.cs index 75b561cb2725..29cf556e7f6b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.cs index 69372f6ea469..3d2db154321a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponseInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IComponentPurgeResponse : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id to use when querying for status for a particular purge operation.", SerializedName = @"operationId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.json.cs index 2e229bc35494..48627ead5c39 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeResponse.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ComponentPurgeResponse(Microsoft.Azure.PowerShell.Cmdlets.ApplicationIn { return; } - {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.PowerShell.cs similarity index 81% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.PowerShell.cs index b4fe81ee1383..91f4bf30de07 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ComponentPurgeStatusResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,13 +78,13 @@ internal ComponentPurgeStatusResponse(global::System.Collections.IDictionary con // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponseInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponseInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,35 @@ internal ComponentPurgeStatusResponse(global::System.Management.Automation.PSObj // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponseInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponseInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ComponentPurgeStatusResponse(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ComponentPurgeStatusResponse(content); } @@ -137,7 +137,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.TypeConverter.cs index c977f723e8f5..69660a62cdb3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.cs similarity index 74% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.cs index 7e350dcdf35f..d9464add4208 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.cs @@ -3,22 +3,22 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState _status; + private string _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; } + public string Status { get => this._status; set => this._status = value; } /// Creates an new instance. public ComponentPurgeStatusResponse() @@ -34,10 +34,14 @@ public partial interface IComponentPurgeStatusResponse : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("pending", "completed")] + string Status { get; set; } } /// Response containing status for a specific purge operation. @@ -45,7 +49,8 @@ internal partial interface IComponentPurgeStatusResponseInternal { /// Status of the operation represented by the requested Id. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("pending", "completed")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.json.cs index 4e483d04ec9f..a35e0b9163db 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ComponentPurgeStatusResponse(Microsoft.Azure.PowerShell.Cmdlets.Applica { return; } - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.PowerShell.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.PowerShell.cs index 6dc7341b4784..ed3b6efcf418 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ComponentsResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,29 +78,29 @@ internal ComponentsResource(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResourceTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -115,51 +115,49 @@ internal ComponentsResource(global::System.Management.Automation.PSObject conten // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResourceTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ComponentsResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ComponentsResource(content); } @@ -169,7 +167,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.TypeConverter.cs index 4275f0586474..2c3cbf996d4c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.cs similarity index 83% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.cs index 58dcae8d61a8..04093e738a68 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal { /// Backing field for property. @@ -28,13 +28,13 @@ public partial class ComponentsResource : 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -44,11 +44,11 @@ public partial class ComponentsResource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -71,14 +71,20 @@ public partial interface IComponentsResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource Id", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] string Id { get; } /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -87,6 +93,9 @@ public partial interface IComponentsResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource name", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -95,14 +104,20 @@ public partial interface IComponentsResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags Tag { get; set; } /// Azure resource type [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource type", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -120,7 +135,7 @@ internal partial interface IComponentsResourceInternal /// Azure resource name string Name { get; set; } /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags Tag { get; set; } /// Azure resource type string Type { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.json.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.json.cs index ec29b0a5db1c..8c704e1dd520 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ComponentsResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsigh { 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;} + {_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.ComponentsResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -104,19 +104,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate)) + { + 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; diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.PowerShell.cs similarity index 89% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.PowerShell.cs index 06ef6723a134..7b799d18f965 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ComponentsResourceTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -82,7 +82,7 @@ internal ComponentsResourceTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -101,29 +101,27 @@ internal ComponentsResourceTags(global::System.Management.Automation.PSObject co } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ComponentsResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ComponentsResourceTags(content); } @@ -133,7 +131,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.TypeConverter.cs index 03259d0a30e0..6d25d8868102 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.cs index fcc17b74aeb4..b971fff66398 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTagsInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.dictionary.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.dictionary.cs index c7c015806687..6dcb777af096 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentsResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.json.cs index 97c5e964c3b4..12552d3d5b95 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResourceTags.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -71,13 +71,13 @@ internal ComponentsResourceTags(Microsoft.Azure.PowerShell.Cmdlets.ApplicationIn } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.PowerShell.cs similarity index 75% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.PowerShell.cs index c0d6411a9f0b..ab72fe1c4b92 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class ErrorDefinition partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorDefinition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorDefinition(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,21 +104,21 @@ internal ErrorDefinition(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Innererror")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -135,15 +133,15 @@ internal ErrorDefinition(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Innererror")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -153,7 +151,7 @@ internal ErrorDefinition(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.TypeConverter.cs index d1003e4055c1..22b6ed4e8656 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.cs similarity index 87% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.cs index 3851679c78c4..858c3367f4d0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error definition. public partial class ErrorDefinition : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal { /// Backing field for property. @@ -37,13 +37,13 @@ public partial class ErrorDefinition : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Innererror - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal.Innererror { get => (this._innererror = this._innererror ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Any()); set { {_innererror = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal.Innererror { get => (this._innererror = this._innererror ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Any()); set { {_innererror = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal.Message { get => this._message; set { {_message = value;} } } /// Creates an new instance. public ErrorDefinition() @@ -61,6 +61,9 @@ public partial interface IErrorDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service specific error code which serves as the substatus for the HTTP error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +72,9 @@ public partial interface IErrorDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Internal error details.", SerializedName = @"innererror", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) })] @@ -77,6 +83,9 @@ public partial interface IErrorDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Description of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.json.cs index f79176aa12ed..5318322b49ee 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorDefinition.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ErrorDefinition(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights. { 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;} - {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Any.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;} + {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Any.FromJson(__jsonInnererror) : _innererror;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ErrorDefinition(json) : null; } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._innererror ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._innererror.ToJson(null,serializationMode) : null, "innererror" ,container.Add ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.PowerShell.cs similarity index 76% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.PowerShell.cs index 8d537f729481..92f38f97bfc1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class ErrorFieldContract partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorFieldContract(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorFieldContract(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,21 +104,21 @@ internal ErrorFieldContract(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Target, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -135,15 +133,15 @@ internal ErrorFieldContract(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal)this).Target, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -153,7 +151,7 @@ internal ErrorFieldContract(global::System.Management.Automation.PSObject conten /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.TypeConverter.cs index 9a42a5f2aedb..041ab5f78373 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.cs index 106df3459e31..627650a7ce6b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error Field contract. public partial class ErrorFieldContract : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContractInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContractInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IErrorFieldContract : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Property level error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IErrorFieldContract : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Human-readable representation of property-level error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IErrorFieldContract : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Property name.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.json.cs index 9846ba964bfd..b542fdc65193 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorFieldContract.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorFieldContract.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ErrorFieldContract(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsigh { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ErrorFieldContract(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 73% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index abb33c908281..76c3aad1377b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -66,33 +66,33 @@ public partial class ErrorResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponse(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,21 +107,21 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorFieldContractTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorFieldContractTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,15 +136,15 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorFieldContractTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorFieldContractTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -154,7 +154,7 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 7b61cf965c55..14af957c62eb 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.cs similarity index 81% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.cs index eb2ed93cfa7d..50bbb8f61adb 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210 /// message. /// public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal { /// Backing field for property. @@ -24,11 +24,11 @@ public partial class ErrorResponse : public string Code { get => this._code; set => this._code = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract[] _detail; + private System.Collections.Generic.List _detail; /// The list of invalid fields send in request, in case of validation error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract[] Detail { get => this._detail; set => this._detail = value; } + public System.Collections.Generic.List Detail { get => this._detail; set => this._detail = value; } /// Backing field for property. private string _message; @@ -52,6 +52,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -60,14 +63,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of invalid fields send in request, in case of validation error.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract[] Detail { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract) })] + System.Collections.Generic.List Detail { get; set; } /// Error message indicating why the operation failed. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -82,7 +91,7 @@ internal partial interface IErrorResponseInternal /// Error code. string Code { get; set; } /// The list of invalid fields send in request, in case of validation error. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// Error message indicating why the operation failed. string Message { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.json.cs index 99717e802326..0a5390282d4f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -68,20 +68,20 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Ru { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.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.Api20210308.IErrorFieldContract) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorFieldContract.FromJson(__u) )) ))() : null : Detail;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorFieldContract) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorFieldContract.FromJson(__u) )) ))() : null : _detail;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.PowerShell.cs similarity index 73% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.PowerShell.cs index 5184abfec79a..843ee0037548 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -62,35 +62,33 @@ public partial class ErrorResponseComponents partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponseComponents(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponseComponents(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +103,21 @@ internal ErrorResponseComponents(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +132,15 @@ internal ErrorResponseComponents(global::System.Management.Automation.PSObject c // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -152,7 +150,7 @@ internal ErrorResponseComponents(global::System.Management.Automation.PSObject c /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.TypeConverter.cs index 192b191287ff..d1af9513fb68 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.cs similarity index 68% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.cs index cb63b46d474a..a470836b32c1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.cs @@ -3,41 +3,41 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError _error; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)Error).Code = value ?? null; } /// 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;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)Error).Message = value ?? null; } /// Creates an new instance. public ErrorResponseComponents() @@ -52,6 +52,9 @@ public partial interface IErrorResponseComponents : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -60,6 +63,9 @@ public partial interface IErrorResponseComponents : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -75,7 +81,7 @@ internal partial interface IErrorResponseComponentsInternal /// 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; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError Error { get; set; } /// Error message indicating why the operation failed. string Message { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.json.cs index a118634219ec..1a2bd6b1ef4d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -64,18 +64,18 @@ internal ErrorResponseComponents(Microsoft.Azure.PowerShell.Cmdlets.ApplicationI { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseComponentsError.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.PowerShell.cs similarity index 80% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.PowerShell.cs index d4a00ab84961..228721267879 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -66,35 +66,35 @@ public partial class ErrorResponseComponentsError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponseComponentsError(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponseComponentsError(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -109,17 +109,17 @@ internal ErrorResponseComponentsError(global::System.Collections.IDictionary con // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,11 +134,11 @@ internal ErrorResponseComponentsError(global::System.Management.Automation.PSObj // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -148,7 +148,7 @@ internal ErrorResponseComponentsError(global::System.Management.Automation.PSObj /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.TypeConverter.cs index 7a38a05345ca..06abc59a50cf 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.cs index cd9a3a0a6d62..107bcaa119ac 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200 /// message. /// public partial class ErrorResponseComponentsError : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal { /// Backing field for property. @@ -31,10 +31,10 @@ public partial class ErrorResponseComponentsError : 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsErrorInternal.Message { get => this._message; set { {_message = value;} } } /// Creates an new instance. public ErrorResponseComponentsError() @@ -51,6 +51,9 @@ public partial interface IErrorResponseComponentsError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -59,6 +62,9 @@ public partial interface IErrorResponseComponentsError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.json.cs index 82c3c270fc95..0dc179caa303 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponentsError.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponentsError.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -68,19 +68,19 @@ internal ErrorResponseComponentsError(Microsoft.Azure.PowerShell.Cmdlets.Applica { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -104,11 +104,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.PowerShell.cs similarity index 71% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.PowerShell.cs index c09e8d29cfb0..8ddf4ed67306 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -62,35 +62,33 @@ public partial class ErrorResponseLinkedStorage partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponseLinkedStorage(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponseLinkedStorage(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +103,21 @@ internal ErrorResponseLinkedStorage(global::System.Collections.IDictionary conte // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +132,15 @@ internal ErrorResponseLinkedStorage(global::System.Management.Automation.PSObjec // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -152,7 +150,7 @@ internal ErrorResponseLinkedStorage(global::System.Management.Automation.PSObjec /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.TypeConverter.cs index bb67e6d3185d..ea787c239d15 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.cs similarity index 66% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.cs index 552ea2d81103..73698469055d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.cs @@ -3,41 +3,41 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError _error; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)Error).Code = value ?? null; } /// 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;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)Error).Message = value ?? null; } /// Creates an new instance. public ErrorResponseLinkedStorage() @@ -52,6 +52,9 @@ public partial interface IErrorResponseLinkedStorage : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -60,6 +63,9 @@ public partial interface IErrorResponseLinkedStorage : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -75,7 +81,7 @@ internal partial interface IErrorResponseLinkedStorageInternal /// 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; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError Error { get; set; } /// Error message indicating why the operation failed. string Message { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.json.cs index 1dddd397881d..be75a39c7fc4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -64,18 +64,18 @@ internal ErrorResponseLinkedStorage(Microsoft.Azure.PowerShell.Cmdlets.Applicati { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorResponseLinkedStorageError.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.PowerShell.cs similarity index 78% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.PowerShell.cs index c8ffa7a1d7f4..5aaf8dc93dc4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -66,35 +66,35 @@ public partial class ErrorResponseLinkedStorageError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponseLinkedStorageError(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponseLinkedStorageError(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -109,17 +109,17 @@ internal ErrorResponseLinkedStorageError(global::System.Collections.IDictionary // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,11 +134,11 @@ internal ErrorResponseLinkedStorageError(global::System.Management.Automation.PS // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -148,7 +148,7 @@ internal ErrorResponseLinkedStorageError(global::System.Management.Automation.PS /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.TypeConverter.cs index 0da3a4f13d51..52ba7a2955be 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.cs index d2e3fc026f2e..611143d5a0f0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200 /// message. /// public partial class ErrorResponseLinkedStorageError : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal { /// Backing field for property. @@ -31,10 +31,10 @@ public partial class ErrorResponseLinkedStorageError : 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageErrorInternal.Message { get => this._message; set { {_message = value;} } } /// Creates an new instance. public ErrorResponseLinkedStorageError() @@ -51,6 +51,9 @@ public partial interface IErrorResponseLinkedStorageError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -59,6 +62,9 @@ public partial interface IErrorResponseLinkedStorageError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.json.cs index 2a0b02e6754e..94213f01a369 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorageError.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorageError.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -68,19 +68,19 @@ internal ErrorResponseLinkedStorageError(Microsoft.Azure.PowerShell.Cmdlets.Appl { 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;} + {_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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -104,11 +104,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.PowerShell.cs similarity index 81% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.PowerShell.cs index e98f8e5d2f3e..2f587e2a96ec 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class HeaderField partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new HeaderField(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new HeaderField(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal HeaderField(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderFieldInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderFieldInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderFieldInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderFieldInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderFieldInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderFieldInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderFieldInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderFieldInternal)this).Value, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal HeaderField(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderFieldInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderFieldInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderFieldInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderFieldInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderFieldInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderFieldInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderFieldInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderFieldInternal)this).Value, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.TypeConverter.cs index 108b3078b2d5..467b3aac2c9c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.cs index 34417428d6c1..b3a1d8bc7c7c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// A header to add to the WebTest. public partial class HeaderField : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderFieldInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderFieldInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IHeaderField : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the header.", SerializedName = @"key", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IHeaderField : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of the header.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.json.cs index cbd011ffdcdb..a6f36760d609 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/HeaderField.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/HeaderField.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class HeaderField 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.Api20220615.IHeaderField. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new HeaderField(json) : null; } @@ -77,8 +77,8 @@ internal HeaderField(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runt { return; } - {_name = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Name;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_name = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)_name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.PowerShell.cs similarity index 78% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.PowerShell.cs index 6fb9ce985d69..1109435ab35f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class InnerError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new InnerError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new InnerError(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal InnerError(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorInternal)this).Diagnosticcontext = (string) content.GetValueForProperty("Diagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorInternal)this).Time = (global::System.DateTime?) content.GetValueForProperty("Time",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal InnerError(global::System.Management.Automation.PSObject content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorInternal)this).Diagnosticcontext = (string) content.GetValueForProperty("Diagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorInternal)this).Time = (global::System.DateTime?) content.GetValueForProperty("Time",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.TypeConverter.cs index 6272d09abf50..2d16901555ed 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.cs index 139c4abb2f66..e5c900b1a532 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IInnerError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides correlation for request", SerializedName = @"diagnosticcontext", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IInnerError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Request time", SerializedName = @"time", PossibleTypes = new [] { typeof(global::System.DateTime) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.json.cs index 6f94a209a853..72b0543976f0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/InnerError.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerError.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class InnerError 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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -77,8 +77,8 @@ internal InnerError(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runti { 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;} + {_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); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.PowerShell.cs similarity index 83% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.PowerShell.cs index b2468f62cd6d..2e27a22af86c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class InnerErrorTrace partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTrace DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new InnerErrorTrace(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTrace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new InnerErrorTrace(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTrace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,13 +111,13 @@ internal InnerErrorTrace(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Trace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTraceInternal)this).Trace = (string[]) content.GetValueForProperty("Trace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTraceInternal)this).Trace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTraceInternal)this).Trace = (System.Collections.Generic.List) content.GetValueForProperty("Trace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTraceInternal)this).Trace, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,7 +132,7 @@ internal InnerErrorTrace(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Trace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTraceInternal)this).Trace = (string[]) content.GetValueForProperty("Trace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTraceInternal)this).Trace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTraceInternal)this).Trace = (System.Collections.Generic.List) content.GetValueForProperty("Trace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTraceInternal)this).Trace, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.TypeConverter.cs index a3b771f2c20f..76419efca06e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTrace ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTrace).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.cs similarity index 74% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.cs index fe942c320d66..0df0aa228380 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.cs @@ -3,25 +3,25 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error details public partial class InnerErrorTrace : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTrace, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTraceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTraceInternal { /// Internal Acessors for Trace - string[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTraceInternal.Trace { get => this._trace; set { {_trace = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTraceInternal.Trace { get => this._trace; set { {_trace = value;} } } /// Backing field for property. - private string[] _trace; + private System.Collections.Generic.List _trace; /// detailed error trace [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string[] Trace { get => this._trace; } + public System.Collections.Generic.List Trace { get => this._trace; } /// Creates an new instance. public InnerErrorTrace() @@ -37,10 +37,13 @@ public partial interface IInnerErrorTrace : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"detailed error trace", SerializedName = @"trace", PossibleTypes = new [] { typeof(string) })] - string[] Trace { get; } + System.Collections.Generic.List Trace { get; } } /// Error details @@ -48,7 +51,7 @@ internal partial interface IInnerErrorTraceInternal { /// detailed error trace - string[] Trace { get; set; } + System.Collections.Generic.List Trace { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.json.cs index 2f3d6174290d..7c7b73875c08 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class InnerErrorTrace 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.Api20210308.IInnerErrorTrace. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTrace. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTrace FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new InnerErrorTrace(json) : null; } @@ -77,7 +77,7 @@ internal InnerErrorTrace(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights. { return; } - {_trace = If( json?.PropertyT("trace"), out var __jsonTrace) ? If( __jsonTrace 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 : Trace;} + {_trace = If( json?.PropertyT("trace"), out var __jsonTrace) ? If( __jsonTrace as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _trace;} AfterFromJson(json); } @@ -100,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { if (null != this._trace) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.PowerShell.cs similarity index 81% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.PowerShell.cs index 708127fce413..4d86c3562955 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class LinkedStorageAccountsProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LinkedStorageAccountsProperties(content); } /// - /// Deserializes a into an instance of 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) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LinkedStorageAccountsProperties(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,13 +113,13 @@ internal LinkedStorageAccountsProperties(global::System.Collections.IDictionary // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsPropertiesInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsPropertiesInternal)this).LinkedStorageAccount, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,7 +134,7 @@ internal LinkedStorageAccountsProperties(global::System.Management.Automation.PS // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsPropertiesInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsPropertiesInternal)this).LinkedStorageAccount, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.TypeConverter.cs index 38b24297b1ed..67bd9313b326 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.cs index d7e196077e23..3acd67bc93ad 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsPropertiesInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface ILinkedStorageAccountsProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Linked storage account resource ID", SerializedName = @"linkedStorageAccount", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.json.cs index d0634f6be1b2..ae7b5bc9c2de 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/LinkedStorageAccountsProperties.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/LinkedStorageAccountsProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LinkedStorageAccountsProperties 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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ILinkedStorageAccountsProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -77,7 +77,7 @@ internal LinkedStorageAccountsProperties(Microsoft.Azure.PowerShell.Cmdlets.Appl { return; } - {_linkedStorageAccount = If( json?.PropertyT("linkedStorageAccount"), out var __jsonLinkedStorageAccount) ? (string)__jsonLinkedStorageAccount : (string)LinkedStorageAccount;} + {_linkedStorageAccount = If( json?.PropertyT("linkedStorageAccount"), out var __jsonLinkedStorageAccount) ? (string)__jsonLinkedStorageAccount : (string)_linkedStorageAccount;} AfterFromJson(json); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.PowerShell.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.PowerShell.cs index ab595a92187c..6a1e416c44a5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ManagedServiceIdentity partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ManagedServiceIdentity(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ManagedServiceIdentity(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api3 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,25 +111,25 @@ internal ManagedServiceIdentity(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -146,19 +144,19 @@ internal ManagedServiceIdentity(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.TypeConverter.cs index 56ca380ac0a7..4722706ee398 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.cs similarity index 81% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.cs index 3158330cbe3c..ab6939eabb75 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.cs @@ -3,21 +3,21 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Managed service identity (system assigned and/or user assigned identities) public partial class ManagedServiceIdentity : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal { /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } /// Backing field for property. private string _principalId; @@ -38,16 +38,16 @@ public partial class ManagedServiceIdentity : public string TenantId { get => this._tenantId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType _type; + private string _type; /// /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities _userAssignedIdentity; /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -55,7 +55,7 @@ public partial class ManagedServiceIdentity : /// The dictionary values can be empty objects ({}) in requests. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// Creates an new instance. public ManagedServiceIdentity() @@ -73,6 +73,9 @@ public partial interface IManagedServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +86,9 @@ public partial interface IManagedServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -93,10 +99,14 @@ public partial interface IManagedServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] + string Type { get; set; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. @@ -105,10 +115,13 @@ public partial interface IManagedServiceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities UserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } } /// Managed service identity (system assigned and/or user assigned identities) @@ -126,13 +139,14 @@ internal partial interface IManagedServiceIdentityInternal /// /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] + string Type { get; set; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. /// The dictionary values can be empty objects ({}) in requests. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.json.cs index 5a036f9cdeae..0159bc4663fd 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ManagedServiceIdentity 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.Api30.IManagedServiceIdentity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ManagedServiceIdentity(json) : null; } @@ -77,10 +77,10 @@ internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.ApplicationIn { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : UserAssignedIdentity;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} AfterFromJson(json); } @@ -103,11 +103,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.PowerShell.cs new file mode 100644 index 000000000000..13ca0bbe4c6f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.PowerShell.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.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights private workbook definition. + [System.ComponentModel.TypeConverter(typeof(MyWorkbookTypeConverter))] + public partial class MyWorkbook + { + + /// + /// 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.IMyWorkbook DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MyWorkbook(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.IMyWorkbook DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MyWorkbook(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.IMyWorkbook 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 MyWorkbook(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.IMyWorkbookInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("UserAssignedIdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("UserAssignedIdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookManagedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Etag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Etag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceEtagTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("SerializedData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SerializedData, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("TimeModified")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).TimeModified = (string) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).TimeModified, global::System.Convert.ToString); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("PropertiesTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).PropertiesTag = (System.Collections.Generic.List) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).UserId, global::System.Convert.ToString); + } + if (content.Contains("SourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SourceId, global::System.Convert.ToString); + } + if (content.Contains("StorageUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).StorageUri, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedAt, (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 MyWorkbook(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.IMyWorkbookInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("UserAssignedIdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("UserAssignedIdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookManagedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Etag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Etag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceEtagTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("SerializedData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SerializedData, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("TimeModified")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).TimeModified = (string) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).TimeModified, global::System.Convert.ToString); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("PropertiesTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).PropertiesTag = (System.Collections.Generic.List) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).UserId, global::System.Convert.ToString); + } + if (content.Contains("SourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SourceId, global::System.Convert.ToString); + } + if (content.Contains("StorageUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).StorageUri, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal)this).SystemDataLastModifiedAt, (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(); + } + } + /// An Application Insights private workbook definition. + [System.ComponentModel.TypeConverter(typeof(MyWorkbookTypeConverter))] + public partial interface IMyWorkbook + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.TypeConverter.cs index 746a670ab718..1f5f43388250 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.cs similarity index 61% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.cs index a994b70a8a0e..410c777b736f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.cs @@ -3,107 +3,131 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// An Application Insights private workbook definition. public partial class MyWorkbook : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource __myWorkbookResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource __myWorkbookResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResource(); /// Workbook category, as defined by the user at creation time. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 5)] - public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).Category = value ?? null; } + public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).Category = value ?? null; } /// The user-defined name of the private workbook. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 2)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).DisplayName = value ?? null; } /// Resource etag [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Etag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Etag = value ?? null /* model class */; } /// Azure resource Id [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Id = value ?? null; } /// Identity used for BYOS [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Identity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Identity = value ?? null /* model class */; } /// The identity type. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityType = value ?? null; } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityType = value ?? null; } /// Customer Managed Identity [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityUserAssignedIdentity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityUserAssignedIdentity = value ?? null /* model class */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind? _kind; + private string _kind; /// The kind of workbook. Choices are user and shared. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 4)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind? Kind { get => this._kind; set => this._kind = value; } + public string Kind { get => this._kind; set => this._kind = value; } /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 3)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Location = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookProperties()); set { {_property = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for TimeModified - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal.TimeModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).TimeModified; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).TimeModified = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.TimeModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).TimeModified; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).TimeModified = value ?? null; } /// Internal Acessors for UserId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookInternal.UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).UserId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookInternal.UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).UserId = value ?? null; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Identity = value ?? null /* model class */; } + + /// Internal Acessors for IdentityUserAssignedIdentity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal.IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).IdentityUserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for UserAssignedIdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal.UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal.UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityPrincipalId = value ?? null; } /// Internal Acessors for UserAssignedIdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal.UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal.UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityTenantId = value ?? null; } /// Azure resource name [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Name = value ?? null; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Name = value ?? null; } /// /// A list of 0 or more tags that are associated with this private workbook definition /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string[] PropertiesTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).Tag = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PropertiesTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).Tag = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties _property; /// Metadata describing a workbook for an Azure resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] @@ -115,94 +139,94 @@ public partial class MyWorkbook : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SerializedData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).SerializedData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).SerializedData = value ?? null; } + public string SerializedData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).SerializedData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).SerializedData = value ?? null; } /// Optional resourceId for a source resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).SourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).SourceId = value ?? null; } + public string SourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).SourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).SourceId = value ?? null; } /// BYOS Storage Account URI [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string StorageUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).StorageUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).StorageUri = value ?? null; } + public string StorageUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).StorageUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).StorageUri = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Tag = value ?? null /* model class */; } /// /// Date and time in UTC of the last modification that was made to this private workbook definition. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string TimeModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).TimeModified; } + public string TimeModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).TimeModified; } /// Azure resource type [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).Type = value ?? null; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).Type = value ?? null; } /// The principal ID of resource identity. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityPrincipalId; } + public string UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityPrincipalId; } /// The tenant ID of resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityTenantId; } + public string UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)__myWorkbookResource).UserAssignedIdentityTenantId; } /// Unique user id of the specific user that owns this private workbook. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).UserId; } + public string UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).UserId; } /// /// This instance's version of the data model. This can change as new features are added that can be marked private workbook. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)Property).Version = value ?? null; } + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).Version = value ?? null; } /// Creates an new instance. public MyWorkbook() @@ -225,12 +249,15 @@ public MyWorkbook() /// An Application Insights private workbook definition. public partial interface IMyWorkbook : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource { /// Workbook category, as defined by the user at creation time. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook category, as defined by the user at creation time.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -239,6 +266,9 @@ public partial interface IMyWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user-defined name of the private workbook.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -247,26 +277,36 @@ public partial interface IMyWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The kind of workbook. Choices are user and shared.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind? Kind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("user", "shared")] + string Kind { get; set; } /// /// A list of 0 or more tags that are associated with this private workbook definition /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of 0 or more tags that are associated with this private workbook definition", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - string[] PropertiesTag { get; set; } + System.Collections.Generic.List PropertiesTag { get; set; } /// /// Configuration of this particular private workbook. Configuration data is a string containing valid JSON /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Configuration of this particular private workbook. Configuration data is a string containing valid JSON", SerializedName = @"serializedData", PossibleTypes = new [] { typeof(string) })] @@ -275,6 +315,9 @@ public partial interface IMyWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional resourceId for a source resource.", SerializedName = @"sourceId", PossibleTypes = new [] { typeof(string) })] @@ -283,6 +326,9 @@ public partial interface IMyWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"BYOS Storage Account URI", SerializedName = @"storageUri", PossibleTypes = new [] { typeof(string) })] @@ -290,57 +336,80 @@ public partial interface IMyWorkbook : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// Date and time in UTC of the last modification that was made to this private workbook definition. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date and time in UTC of the last modification that was made to this private workbook definition.", SerializedName = @"timeModified", PossibleTypes = new [] { typeof(string) })] @@ -349,6 +418,9 @@ public partial interface IMyWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Unique user id of the specific user that owns this private workbook.", SerializedName = @"userId", PossibleTypes = new [] { typeof(string) })] @@ -359,6 +431,9 @@ public partial interface IMyWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This instance's version of the data model. This can change as new features are added that can be marked private workbook.", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -367,20 +442,21 @@ public partial interface IMyWorkbook : } /// An Application Insights private workbook definition. internal partial interface IMyWorkbookInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal { /// Workbook category, as defined by the user at creation time. string Category { get; set; } /// The user-defined name of the private workbook. string DisplayName { get; set; } /// The kind of workbook. Choices are user and shared. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind? Kind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("user", "shared")] + string Kind { get; set; } /// /// A list of 0 or more tags that are associated with this private workbook definition /// - string[] PropertiesTag { get; set; } + System.Collections.Generic.List PropertiesTag { get; set; } /// Metadata describing a workbook for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties Property { get; set; } /// /// Configuration of this particular private workbook. Configuration data is a string containing valid JSON /// @@ -390,19 +466,21 @@ internal partial interface IMyWorkbookInternal : /// BYOS Storage Account URI string StorageUri { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// Date and time in UTC of the last modification that was made to this private workbook definition. /// diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.json.cs index 8ee09de14f86..61dcc07909b9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MyWorkbook 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.Api20210308.IMyWorkbook. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new MyWorkbook(json) : null; } @@ -77,10 +77,10 @@ internal MyWorkbook(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runti { return; } - __myWorkbookResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + __myWorkbookResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)_kind;} AfterFromJson(json); } @@ -105,7 +105,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN } __myWorkbookResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.PowerShell.cs similarity index 70% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.PowerShell.cs index a1fca58dfe5f..a60482d9253a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MyWorkbookError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MyWorkbookError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MyWorkbookError(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,25 +111,25 @@ internal MyWorkbookError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorDefinitionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorDefinitionTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Innererror")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -146,19 +144,19 @@ internal MyWorkbookError(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorDefinitionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorDefinitionTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Innererror")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.TypeConverter.cs index 2944a4ca9a7c..0ddb8facef82 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.cs similarity index 72% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.cs index fb22f4cdfb1d..b2f2d98d3c41 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error response. public partial class MyWorkbookError : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal { /// @@ -18,37 +18,37 @@ public partial class MyWorkbookError : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition _error; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition _error; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorDefinition()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorDefinition()); set => this._error = value; } /// Internal error details. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Innererror { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)Error).Innererror; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Innererror { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)Error).Innererror; } /// Description of the error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)Error).Code = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorDefinition()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorDefinition()); set { {_error = value;} } } /// Internal Acessors for Innererror - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal.Innererror { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)Error).Innererror; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)Error).Innererror = value; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal.Innererror { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)Error).Innererror; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)Error).Innererror = value ?? null /* model class */; } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookErrorInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinitionInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinitionInternal)Error).Message = value ?? null; } /// Creates an new instance. public MyWorkbookError() @@ -66,6 +66,9 @@ public partial interface IMyWorkbookError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service specific error code which serves as the substatus for the HTTP error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -74,6 +77,9 @@ public partial interface IMyWorkbookError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Internal error details.", SerializedName = @"innererror", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) })] @@ -82,6 +88,9 @@ public partial interface IMyWorkbookError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Description of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -97,7 +106,7 @@ internal partial interface IMyWorkbookErrorInternal /// string Code { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorDefinition Error { get; set; } /// Internal error details. Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Innererror { get; set; } /// Description of the error. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.json.cs index 957b1671988e..69a58c762068 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MyWorkbookError 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.Api20210308.IMyWorkbookError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new MyWorkbookError(json) : null; } @@ -77,7 +77,7 @@ internal MyWorkbookError(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights. { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.ErrorDefinition.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ErrorDefinition.FromJson(__jsonError) : _error;} AfterFromJson(json); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.PowerShell.cs similarity index 68% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.PowerShell.cs index 8c5f6dbbddab..ecbd5af43eb1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MyWorkbookManagedIdentity partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MyWorkbookManagedIdentity(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MyWorkbookManagedIdentity(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,25 +111,25 @@ internal MyWorkbookManagedIdentity(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -146,19 +144,19 @@ internal MyWorkbookManagedIdentity(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.TypeConverter.cs index 0ed24c81c820..cf6fbff78eb4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.cs index 8c6f05ded4e5..d8d32dd47937 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.cs @@ -3,24 +3,24 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Customer Managed Identity public partial class MyWorkbookManagedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal { /// Internal Acessors for UserAssignedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal.UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookUserAssignedIdentities()); set { {_userAssignedIdentity = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal.UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookUserAssignedIdentities()); set { {_userAssignedIdentity = value;} } } /// Internal Acessors for UserAssignedIdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal.UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).PrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal.UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).PrincipalId = value ?? null; } /// Internal Acessors for UserAssignedIdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal.UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).TenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal.UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).TenantId = value ?? null; } /// Backing field for property. private string _type; @@ -31,22 +31,22 @@ public partial class MyWorkbookManagedIdentity : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities _userAssignedIdentity; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities _userAssignedIdentity; /// Customer Managed Identity [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookUserAssignedIdentities()); set => this._userAssignedIdentity = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookUserAssignedIdentities()); set => this._userAssignedIdentity = value; } /// The principal ID of resource identity. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).PrincipalId; } + public string UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).PrincipalId; } /// The tenant ID of resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).TenantId; } + public string UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).TenantId; } /// Creates an new instance. public MyWorkbookManagedIdentity() @@ -62,6 +62,9 @@ public partial interface IMyWorkbookManagedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -70,6 +73,9 @@ public partial interface IMyWorkbookManagedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal ID of resource identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -78,6 +84,9 @@ public partial interface IMyWorkbookManagedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of resource.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -91,7 +100,7 @@ internal partial interface IMyWorkbookManagedIdentityInternal /// The identity type. string Type { get; set; } /// Customer Managed Identity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities UserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities UserAssignedIdentity { get; set; } /// The principal ID of resource identity. string UserAssignedIdentityPrincipalId { get; set; } /// The tenant ID of resource. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.json.cs index 38abf3fe2a44..928bd5eaf34a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MyWorkbookManagedIdentity 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.Api20210308.IMyWorkbookManagedIdentity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new MyWorkbookManagedIdentity(json) : null; } @@ -77,8 +77,8 @@ internal MyWorkbookManagedIdentity(Microsoft.Azure.PowerShell.Cmdlets.Applicatio { return; } - {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : UserAssignedIdentity;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.PowerShell.cs similarity index 62% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.PowerShell.cs index 7a3477a68abd..9de61b06486d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MyWorkbookProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MyWorkbookProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MyWorkbookProperties(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,45 +111,45 @@ internal MyWorkbookProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("SerializedData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).SerializedData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).SerializedData, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Version, global::System.Convert.ToString); } if (content.Contains("TimeModified")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).TimeModified = (string) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).TimeModified, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).TimeModified = (string) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).TimeModified, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Tag = (System.Collections.Generic.List) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("UserId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).UserId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).UserId, global::System.Convert.ToString); } if (content.Contains("SourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).SourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).SourceId, global::System.Convert.ToString); } if (content.Contains("StorageUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).StorageUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).StorageUri, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -166,39 +164,39 @@ internal MyWorkbookProperties(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("SerializedData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).SerializedData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).SerializedData, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Version, global::System.Convert.ToString); } if (content.Contains("TimeModified")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).TimeModified = (string) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).TimeModified, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).TimeModified = (string) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).TimeModified, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Tag = (System.Collections.Generic.List) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("UserId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).UserId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).UserId, global::System.Convert.ToString); } if (content.Contains("SourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).SourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).SourceId, global::System.Convert.ToString); } if (content.Contains("StorageUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal)this).StorageUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).StorageUri, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.TypeConverter.cs index 87270abc761e..86cf0ba5c0f2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.cs index e29ea3515814..b0c5eb7edf09 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Properties that contain a private workbook. public partial class MyWorkbookProperties : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal { /// Backing field for property. @@ -30,10 +30,10 @@ public partial class MyWorkbookProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for TimeModified - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal.TimeModified { get => this._timeModified; set { {_timeModified = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal.TimeModified { get => this._timeModified; set { {_timeModified = value;} } } /// Internal Acessors for UserId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookPropertiesInternal.UserId { get => this._userId; set { {_userId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal.UserId { get => this._userId; set { {_userId = value;} } } /// Backing field for property. private string _serializedData; @@ -62,14 +62,14 @@ public partial class MyWorkbookProperties : public string StorageUri { get => this._storageUri; set => this._storageUri = value; } /// Backing field for property. - private string[] _tag; + private System.Collections.Generic.List _tag; /// /// A list of 0 or more tags that are associated with this private workbook definition /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string[] Tag { get => this._tag; set => this._tag = value; } + public System.Collections.Generic.List Tag { get => this._tag; set => this._tag = value; } /// Backing field for property. private string _timeModified; @@ -113,6 +113,9 @@ public partial interface IMyWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook category, as defined by the user at creation time.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -121,6 +124,9 @@ public partial interface IMyWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user-defined name of the private workbook.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -131,6 +137,9 @@ public partial interface IMyWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Configuration of this particular private workbook. Configuration data is a string containing valid JSON", SerializedName = @"serializedData", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +148,9 @@ public partial interface IMyWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional resourceId for a source resource.", SerializedName = @"sourceId", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +159,9 @@ public partial interface IMyWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"BYOS Storage Account URI", SerializedName = @"storageUri", PossibleTypes = new [] { typeof(string) })] @@ -157,16 +172,22 @@ public partial interface IMyWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of 0 or more tags that are associated with this private workbook definition", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - string[] Tag { get; set; } + System.Collections.Generic.List Tag { get; set; } /// /// Date and time in UTC of the last modification that was made to this private workbook definition. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date and time in UTC of the last modification that was made to this private workbook definition.", SerializedName = @"timeModified", PossibleTypes = new [] { typeof(string) })] @@ -175,6 +196,9 @@ public partial interface IMyWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Unique user id of the specific user that owns this private workbook.", SerializedName = @"userId", PossibleTypes = new [] { typeof(string) })] @@ -185,6 +209,9 @@ public partial interface IMyWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This instance's version of the data model. This can change as new features are added that can be marked private workbook.", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -210,7 +237,7 @@ internal partial interface IMyWorkbookPropertiesInternal /// /// A list of 0 or more tags that are associated with this private workbook definition /// - string[] Tag { get; set; } + System.Collections.Generic.List Tag { get; set; } /// /// Date and time in UTC of the last modification that was made to this private workbook definition. /// diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.json.cs index 3c7b5acee536..89aac827e1a3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MyWorkbookProperties 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.Api20210308.IMyWorkbookProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new MyWorkbookProperties(json) : null; } @@ -77,15 +77,15 @@ internal MyWorkbookProperties(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsi { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_serializedData = If( json?.PropertyT("serializedData"), out var __jsonSerializedData) ? (string)__jsonSerializedData : (string)SerializedData;} - {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} - {_timeModified = If( json?.PropertyT("timeModified"), out var __jsonTimeModified) ? (string)__jsonTimeModified : (string)TimeModified;} - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags 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 : Tag;} - {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} - {_sourceId = If( json?.PropertyT("sourceId"), out var __jsonSourceId) ? (string)__jsonSourceId : (string)SourceId;} - {_storageUri = If( json?.PropertyT("storageUri"), out var __jsonStorageUri) ? (string)__jsonStorageUri : (string)StorageUri;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_serializedData = If( json?.PropertyT("serializedData"), out var __jsonSerializedData) ? (string)__jsonSerializedData : (string)_serializedData;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} + {_timeModified = If( json?.PropertyT("timeModified"), out var __jsonTimeModified) ? (string)__jsonTimeModified : (string)_timeModified;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _tag;} + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)_userId;} + {_sourceId = If( json?.PropertyT("sourceId"), out var __jsonSourceId) ? (string)__jsonSourceId : (string)_sourceId;} + {_storageUri = If( json?.PropertyT("storageUri"), out var __jsonStorageUri) ? (string)__jsonStorageUri : (string)_storageUri;} AfterFromJson(json); } @@ -111,7 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); AddIf( null != (((object)this._serializedData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._serializedData.ToString()) : null, "serializedData" ,container.Add ); AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._timeModified)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._timeModified.ToString()) : null, "timeModified" ,container.Add ); } @@ -125,7 +125,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN } container.Add("tags",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.PowerShell.cs similarity index 55% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.PowerShell.cs index 357722683bd6..a86fd080a542 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MyWorkbookResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MyWorkbookResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MyWorkbookResource(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,53 +111,53 @@ internal MyWorkbookResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookManagedIdentityTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookManagedIdentityTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Etag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Etag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceEtagTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Etag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Etag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceEtagTypeConverter.ConvertFrom); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -174,47 +172,47 @@ internal MyWorkbookResource(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookManagedIdentityTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookManagedIdentityTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Etag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).Etag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceEtagTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Etag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).Etag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceEtagTypeConverter.ConvertFrom); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookUserAssignedIdentitiesTypeConverter.ConvertFrom); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId = (string) content.GetValueForProperty("UserAssignedIdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.TypeConverter.cs index 3438208981ec..fcfab0f63a9b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.cs similarity index 72% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.cs index e5b515ef9d54..ff0914d9f9c0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.cs @@ -3,23 +3,23 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// An azure resource object public partial class MyWorkbookResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag _etag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag _etag; /// Resource etag [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag Etag { get => (this._etag = this._etag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceEtag()); set => this._etag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag Etag { get => (this._etag = this._etag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceEtag()); set => this._etag = value; } /// Backing field for property. private string _id; @@ -30,17 +30,17 @@ public partial class MyWorkbookResource : public string Id { get => this._id; set => this._id = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity _identity; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity _identity; /// Identity used for BYOS [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookManagedIdentity()); set => this._identity = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookManagedIdentity()); set => this._identity = value; } /// The identity type. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).Type = value ?? null; } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).Type = value ?? null; } /// Backing field for property. private string _location; @@ -51,16 +51,16 @@ public partial class MyWorkbookResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookManagedIdentity()); set { {_identity = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookManagedIdentity()); set { {_identity = value;} } } /// Internal Acessors for IdentityUserAssignedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal.IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentity = value; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal.IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Internal Acessors for UserAssignedIdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal.UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal.UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityPrincipalId = value ?? null; } /// Internal Acessors for UserAssignedIdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceInternal.UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceInternal.UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityTenantId = value ?? null; } /// Backing field for property. private string _name; @@ -71,12 +71,12 @@ public partial class MyWorkbookResource : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -89,12 +89,12 @@ public partial class MyWorkbookResource : /// The principal ID of resource identity. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityPrincipalId; } + public string UserAssignedIdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityPrincipalId; } /// The tenant ID of resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityTenantId; } + public string UserAssignedIdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityTenantId; } /// Creates an new instance. public MyWorkbookResource() @@ -110,14 +110,20 @@ public partial interface IMyWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource etag", SerializedName = @"etag", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag Etag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag Etag { get; set; } /// Azure resource Id [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Azure resource Id", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -126,6 +132,9 @@ public partial interface IMyWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -134,6 +143,9 @@ public partial interface IMyWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -142,6 +154,9 @@ public partial interface IMyWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Azure resource name", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -150,14 +165,20 @@ public partial interface IMyWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags Tag { get; set; } /// Azure resource type [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Azure resource type", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -166,6 +187,9 @@ public partial interface IMyWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal ID of resource identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -174,6 +198,9 @@ public partial interface IMyWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of resource.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -185,21 +212,21 @@ internal partial interface IMyWorkbookResourceInternal { /// Resource etag - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag Etag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag Etag { get; set; } /// Azure resource Id string Id { get; set; } /// Identity used for BYOS - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookManagedIdentity Identity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity Identity { get; set; } /// The identity type. string IdentityType { get; set; } /// Customer Managed Identity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// Resource location string Location { get; set; } /// Azure resource name string Name { get; set; } /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags Tag { get; set; } /// Azure resource type string Type { get; set; } /// The principal ID of resource identity. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.json.cs similarity index 74% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.json.cs index 350ce4122fdb..f5df347ce00a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MyWorkbookResource 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.Api20210308.IMyWorkbookResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new MyWorkbookResource(json) : null; } @@ -77,13 +77,13 @@ internal MyWorkbookResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsigh { return; } - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookManagedIdentity.FromJson(__jsonIdentity) : Identity;} - {_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.Api20210308.MyWorkbookResourceTags.FromJson(__jsonTags) : Tag;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceEtag.FromJson(__jsonEtag) : Etag;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookManagedIdentity.FromJson(__jsonIdentity) : _identity;} + {_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.MyWorkbookResourceTags.FromJson(__jsonTags) : _tag;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceEtag.FromJson(__jsonEtag) : _etag;} AfterFromJson(json); } @@ -107,10 +107,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN return container; } AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,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._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._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 ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate)) + { + 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.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate)) + { + 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.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate)) + { + 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 ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate)) + { + 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 ); AddIf( null != this._etag ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._etag.ToJson(null,serializationMode) : null, "etag" ,container.Add ); AfterToJson(ref container); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.PowerShell.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.PowerShell.cs index a9ca5399e77c..f89052e72153 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MyWorkbookResourceEtag partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MyWorkbookResourceEtag(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MyWorkbookResourceEtag(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -117,7 +115,7 @@ internal MyWorkbookResourceEtag(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.TypeConverter.cs index 8926b978b718..81ae572c6e75 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.cs index 35c0228f0da2..070d6bf8de8d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Resource etag public partial class MyWorkbookResourceEtag : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtagInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtagInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.dictionary.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.dictionary.cs index 91f053bec0df..408ae0a4a705 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceEtag source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceEtag source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.json.cs index 9e376e1106ee..24496d240462 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceEtag.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceEtag.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MyWorkbookResourceEtag 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.Api20210308.IMyWorkbookResourceEtag. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new MyWorkbookResourceEtag(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.PowerShell.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.PowerShell.cs index 898f037e9b2c..d708f41ca579 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MyWorkbookResourceTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MyWorkbookResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MyWorkbookResourceTags(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -117,7 +115,7 @@ internal MyWorkbookResourceTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.TypeConverter.cs index 88558f8adb6f..c47153d7ca42 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.cs index 80b01e318eb0..4d6daf579c0c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Resource tags public partial class MyWorkbookResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTagsInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.dictionary.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.dictionary.cs index 584416e91fc4..3c1c365e7e22 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.json.cs index 1628b752419a..598397319bdf 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResourceTags.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MyWorkbookResourceTags 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.Api20210308.IMyWorkbookResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new MyWorkbookResourceTags(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.PowerShell.cs similarity index 78% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.PowerShell.cs index 0bc006d4cbf0..6e69e1ddde01 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class MyWorkbookUserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20210308.IMyWorkbookUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MyWorkbookUserAssignedIdentities(content); } /// - /// Deserializes a into an instance of 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.Api20210308.IMyWorkbookUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MyWorkbookUserAssignedIdentities(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,17 +113,17 @@ internal MyWorkbookUserAssignedIdentities(global::System.Collections.IDictionary // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)this).TenantId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,11 +138,11 @@ internal MyWorkbookUserAssignedIdentities(global::System.Management.Automation.P // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal)this).TenantId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.TypeConverter.cs index ebcad5d33feb..7155e57a7bc7 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.cs similarity index 87% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.cs index 06dc941f568f..4536e6320429 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.cs @@ -3,21 +3,21 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Customer Managed Identity public partial class MyWorkbookUserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal { /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentitiesInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentitiesInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } /// Backing field for property. private string _principalId; @@ -49,6 +49,9 @@ public partial interface IMyWorkbookUserAssignedIdentities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal ID of resource identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -57,6 +60,9 @@ public partial interface IMyWorkbookUserAssignedIdentities : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of resource.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.json.cs index 755573708df6..f2f08de5044e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookUserAssignedIdentities.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookUserAssignedIdentities.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MyWorkbookUserAssignedIdentities 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.Api20210308.IMyWorkbookUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new MyWorkbookUserAssignedIdentities(json) : null; } @@ -77,8 +77,8 @@ internal MyWorkbookUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.App { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} AfterFromJson(json); } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.PowerShell.cs similarity index 75% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.PowerShell.cs index 326ae0e3e570..abe02e236fb9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class MyWorkbooksListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MyWorkbooksListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MyWorkbooksListResult(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,17 +111,17 @@ internal MyWorkbooksListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,11 +136,11 @@ internal MyWorkbooksListResult(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbookTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbookTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.TypeConverter.cs index 84c431176c4f..d7452e1f3255 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.cs similarity index 71% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.cs index 728a5de9649d..c3417588668c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.cs @@ -3,18 +3,18 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Workbook list result. public partial class MyWorkbooksListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -24,12 +24,12 @@ public partial class MyWorkbooksListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook[] _value; + private System.Collections.Generic.List _value; /// An array of private workbooks. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public MyWorkbooksListResult() @@ -44,6 +44,9 @@ public partial interface IMyWorkbooksListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,13 @@ public partial interface IMyWorkbooksListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"An array of private workbooks.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook) })] + System.Collections.Generic.List Value { get; } } /// Workbook list result. @@ -64,7 +70,7 @@ internal partial interface IMyWorkbooksListResultInternal { string NextLink { get; set; } /// An array of private workbooks. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.json.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.json.cs index 0b23d28d69e6..e445c1318d9c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MyWorkbooksListResult 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.Api20210308.IMyWorkbooksListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new MyWorkbooksListResult(json) : null; } @@ -77,8 +77,8 @@ internal MyWorkbooksListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationIns { 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.Api20210308.IMyWorkbook) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbook.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.PowerShell.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.PowerShell.cs index 5242c9fc3e2b..fa7581ded062 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Operation partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Operation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Operation(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,29 +111,29 @@ internal Operation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -148,23 +148,23 @@ internal Operation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.TypeConverter.cs index c816d0eb07c3..4ec6af2b2177 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.cs similarity index 77% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.cs index 4d11395d2599..7283b02cf97e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.cs @@ -3,37 +3,37 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Azure Workbooks REST API operation public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.Api20210308.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.Api20210308.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)Display).Operation = value ?? null; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } /// Service provider: Microsoft.Insights [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)Display).Provider = value ?? null; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.Api20210308.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)Display).Resource = value ?? null; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationDisplay()); set { {_display = value;} } } /// Backing field for property. private string _name; @@ -56,6 +56,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation type: Read, write, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +67,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft.Insights", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -72,6 +78,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource on which the operation is performed: Profile, endpoint, etc.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -80,6 +89,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation name: {provider}/{resource}/{operation}", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -91,7 +103,7 @@ internal partial interface IOperationInternal { /// The object that represents the operation. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay Display { get; set; } /// Operation type: Read, write, delete, etc. string DisplayOperation { get; set; } /// Service provider: Microsoft.Insights diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.json.cs index 0c8167260fc1..45a34567023f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Operation 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.Api20210308.IOperation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new Operation(json) : null; } @@ -77,8 +77,8 @@ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtim { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 76% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index dd0c1fbb3a30..a64fe19dead6 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class OperationDisplay partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationDisplay(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,21 +111,21 @@ internal OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -142,15 +140,15 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index b09ac88517ce..8b5fddb1f321 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.cs index 40bc5069a057..400096df4c46 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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.Api20210308.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation type: Read, write, delete, etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft.Insights", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource on which the operation is performed: Profile, endpoint, etc.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.json.cs index 32015755c0ad..f538102c53e0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay 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.Api20210308.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -77,9 +77,9 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights { 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;} + {_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); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.PowerShell.cs similarity index 76% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.PowerShell.cs index a9c5a1271c99..0c8299e2963e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -66,29 +66,27 @@ public partial class OperationListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationListResult(content); } @@ -98,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -116,17 +114,17 @@ internal OperationListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -141,11 +139,11 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs index a6ba09f4ba3f..f06ced469e00 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.cs similarity index 80% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.cs index 908e1a86a77a..b7edd99e0f89 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210 /// set of results. /// public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal { /// Backing field for property. @@ -24,13 +24,13 @@ public partial class OperationListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation[] _value; + private System.Collections.Generic.List _value; /// /// List of Workbook operations supported by the Microsoft.Insights resource provider. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public OperationListResult() @@ -47,6 +47,9 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"URL to get the next set of operation list results if there are any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -57,10 +60,13 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of Workbook operations supported by the Microsoft.Insights resource provider.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation) })] + System.Collections.Generic.List Value { get; set; } } /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next @@ -73,7 +79,7 @@ internal partial interface IOperationListResultInternal /// /// List of Workbook operations supported by the Microsoft.Insights resource provider. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.json.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.json.cs index 53c5bd091756..bfe2fbac1c93 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20210308 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class OperationListResult 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.Api20210308.IOperationListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -80,8 +80,8 @@ internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsig { 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.Api20210308.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.Operation.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Operation.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.PowerShell.cs similarity index 79% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.PowerShell.cs index f0db1fb2bf49..7a05a046716b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class PrivateLinkScopedResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkScopedResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkScopedResource(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,17 +111,17 @@ internal PrivateLinkScopedResource(global::System.Collections.IDictionary conten // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResourceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResourceInternal)this).ScopeId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,11 +136,11 @@ internal PrivateLinkScopedResource(global::System.Management.Automation.PSObject // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResourceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResourceInternal)this).ScopeId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.TypeConverter.cs index 74d3b5bf4757..57fc96ec8be3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.cs index aa8977122555..494f9bca5090 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResourceInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IPrivateLinkScopedResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The full resource Id of the private link scope resource.", SerializedName = @"ResourceId", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IPrivateLinkScopedResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The private link scope unique Identifier.", SerializedName = @"ScopeId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.json.cs index 95d8e3ba015e..c7f9fc39f2e1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/PrivateLinkScopedResource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/PrivateLinkScopedResource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateLinkScopedResource 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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IPrivateLinkScopedResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -77,8 +77,8 @@ internal PrivateLinkScopedResource(Microsoft.Azure.PowerShell.Cmdlets.Applicatio { 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;} + {_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); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.PowerShell.cs similarity index 79% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.PowerShell.cs index ad9a0f768c99..8144f9d10c6c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class ProxyResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ProxyResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ProxyResource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api1 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,21 +113,21 @@ internal ProxyResource(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -142,15 +142,15 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs index b0b472933cf2..413287cd6028 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IProxyResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.cs similarity index 74% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.cs index 27c620b1cb3e..fd7d7dda1e96 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -11,40 +11,40 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10 /// 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.Models.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Id = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Name = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Type = value ?? null; } /// 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; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public ProxyResource() @@ -67,13 +67,13 @@ public ProxyResource() /// 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal { } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.json.cs index debd8f9aba5d..11a77bfa72b8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ProxyResource 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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IProxyResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IProxyResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -79,7 +79,7 @@ internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Ru { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(json); + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Resource(json); AfterFromJson(json); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 79% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.PowerShell.cs index b23aeb837ff0..27dde34898ee 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class Resource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Resource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api1 /// /// 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)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,21 +113,21 @@ internal Resource(global::System.Collections.IDictionary content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -142,15 +142,15 @@ internal Resource(global::System.Management.Automation.PSObject content) // 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 98% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.TypeConverter.cs index 117e750421ac..2b91ff27b820 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.cs index b95c6322d33c..2cf77f359085 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10 /// 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 + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal { /// Backing field for property. @@ -25,13 +25,13 @@ public partial class Resource : 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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -65,6 +65,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +76,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.json.cs index c61c72b8faee..d7bc56b4675d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Resource 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. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } @@ -79,9 +79,9 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime { 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;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 65% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.PowerShell.cs index f6277cc2d178..a34f815b3edd 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class SystemData partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SystemData(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api1 /// /// 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.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,33 +111,33 @@ internal SystemData(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedAt, (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 into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -152,27 +152,27 @@ internal SystemData(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 1a712bf5d2c1..4668400de2af 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.cs index b9da52e29f6d..45b1daa651f1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class SystemData : public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + public string CreatedByType { get => this._createdByType; set => this._createdByType = value; } /// Backing field for property. private global::System.DateTime? _lastModifiedAt; @@ -49,11 +49,11 @@ public partial class SystemData : public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + public string LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } /// Creates an new instance. public SystemData() @@ -69,6 +69,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -77,6 +80,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] @@ -85,14 +91,21 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -101,6 +114,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] @@ -109,10 +125,14 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } /// Metadata pertaining to creation and last modification of the resource. @@ -124,13 +144,15 @@ internal partial interface ISystemDataInternal /// The identity that created the resource. string CreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? LastModifiedAt { get; set; } /// The identity that last modified the resource. string LastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.json.cs index 115929dd272b..3796fbca2581 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData 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.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runti { return; } - {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} - {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} - {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} - {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} - {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)_createdBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)_createdByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : _createdAt : _createdAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)_lastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)_lastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : _lastModifiedAt : _lastModifiedAt;} AfterFromJson(json); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.PowerShell.cs similarity index 82% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.PowerShell.cs index dcdf2a077e78..664ac75d4f1c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class TagsResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TagsResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TagsResource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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.ITagsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,13 +113,13 @@ internal TagsResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TagsResourceTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,7 +134,7 @@ internal TagsResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TagsResourceTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.TypeConverter.cs index dea24c6ea565..2232948bffc8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.cs similarity index 81% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.cs index 5484f38de2ef..f6a8bea04b9a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200 /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. /// public partial class TagsResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TagsResourceTags()); set => this._tag = value; } /// Creates an new instance. public TagsResource() @@ -36,10 +36,13 @@ public partial interface ITagsResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags Tag { get; set; } } /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. @@ -47,7 +50,7 @@ internal partial interface ITagsResourceInternal { /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.json.cs index 62fb71a4d561..40c7c85bfb07 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class TagsResource 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.ITagsResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new TagsResource(json) : null; } @@ -79,7 +79,7 @@ internal TagsResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Run { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResourceTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TagsResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.PowerShell.cs similarity index 89% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.PowerShell.cs index 6e41405efde2..d3878a820156 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class TagsResourceTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TagsResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TagsResourceTags(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// 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.ITagsResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -115,7 +115,7 @@ internal TagsResourceTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.TypeConverter.cs index 67f1ed2ce352..745f9d35b2ac 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.cs similarity index 92% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.cs index cef4303a4b21..a2abb7baf001 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Resource tags public partial class TagsResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTagsInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.dictionary.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.dictionary.cs index 180fe4fffccc..eabd9625be1a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TagsResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.json.cs index c4240f0d3ec1..63f3712d7eeb 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/TagsResourceTags.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TagsResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TagsResourceTags 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.ITagsResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new TagsResourceTags(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.PowerShell.cs similarity index 72% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.PowerShell.cs index 294bd9a97935..b47ee4d4d96c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class TrackedResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TrackedResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrackedResource(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api1 /// /// 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.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,29 +130,29 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -167,23 +167,23 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs index 01c0416b8f53..776beb6f406f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.cs similarity index 76% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.cs index fe87069248eb..555b0da2354b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -11,21 +11,21 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10 /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' /// public partial class TrackedResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal, 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Id; } /// Backing field for property. private string _location; @@ -35,30 +35,30 @@ public partial class TrackedResource : public string Location { get => this._location; set => this._location = value; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Id = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Name = value ?? null; } /// 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; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Type = value ?? null; } /// 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; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTags()); set => this._tag = value; } /// /// 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; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public TrackedResource() @@ -81,12 +81,15 @@ public TrackedResource() /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' public partial interface ITrackedResource : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource { /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The geo-location where the resource lives", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -95,20 +98,23 @@ public partial interface ITrackedResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' internal partial interface ITrackedResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal { /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.json.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.json.cs index 44a6591723af..002f63a9d4ab 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class TrackedResource 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.ITrackedResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; } @@ -88,7 +88,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN } __resource?.ToJson(container, serializationMode); AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,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 ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate)) + { + 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 ); + } AfterToJson(ref container); return container; } @@ -105,9 +108,9 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights. { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTags.FromJson(__jsonTags) : Tag;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Resource(json); + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 89% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs index e3b240986921..80fb0b76cfea 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class TrackedResourceTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TrackedResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrackedResourceTags(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api1 /// /// 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.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -132,7 +132,7 @@ internal TrackedResourceTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs index e3280a2ea8a3..2d682e11ae4d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.cs index ae8552b468f3..eb2ec6becb6b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.cs @@ -3,14 +3,14 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Resource tags. public partial class TrackedResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTagsInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs index 8d2d2c844940..2b2c7b62223d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.json.cs index c9d8088cbbb4..8583da1704e2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by 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 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TrackedResourceTags 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.ITrackedResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs index ee2f886e8a18..47f35e45363f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -67,29 +67,27 @@ public partial class UserAssignedIdentities partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserAssignedIdentities(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserAssignedIdentities(content); } @@ -99,7 +97,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api3 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -119,7 +117,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -138,7 +136,7 @@ internal UserAssignedIdentities(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs index 3df7dcc053d9..2e4b38b3ae6b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.cs index 9798e0ac3e33..2d5c45711511 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -13,8 +13,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30 /// The dictionary values can be empty objects ({}) in requests. /// public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentitiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentitiesInternal { /// Creates an new instance. @@ -28,7 +28,7 @@ public UserAssignedIdentities() /// The dictionary values can be empty objects ({}) in requests. public partial interface IUserAssignedIdentities : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray { } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs similarity index 66% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs index b00a8efcd75d..5532e5787d30 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs @@ -3,28 +3,28 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + 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; } + 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; } + 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.Keys { get => __additionalProperties.Keys; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } /// /// - public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity value) => __additionalProperties.Add( key, value); + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity value) => __additionalProperties.Add( key, value); public void Clear() => __additionalProperties.Clear(); @@ -40,7 +40,7 @@ public void CopyFrom(global::System.Collections.IDictionary source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -55,7 +55,7 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); } } } @@ -66,10 +66,10 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// /// - public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentities source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentities source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.json.cs similarity index 92% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.json.cs index cd360bbbbf19..5b7a9211c3b1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -58,13 +58,13 @@ public partial class UserAssignedIdentities 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.Api30.IUserAssignedIdentities. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; } @@ -88,7 +88,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, container); + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, container); AfterToJson(ref container); return container; } @@ -106,7 +106,7 @@ internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.ApplicationIn { return; } - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentity.FromJson(j) ,exclusions ); + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs similarity index 80% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs index 3b7184ce831c..152f2842cd76 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class UserAssignedIdentity partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserAssignedIdentity(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserAssignedIdentity(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api3 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,17 +128,17 @@ internal UserAssignedIdentity(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -153,11 +153,11 @@ internal UserAssignedIdentity(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("ClientId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs index b064320aee42..d4f55bbb08fe 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.cs index 4e16a32eed68..75ea4f313976 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// User assigned identity properties public partial class UserAssignedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class UserAssignedIdentity : public string ClientId { get => this._clientId; } /// Internal Acessors for ClientId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal.ClientId { get => this._clientId; set { {_clientId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal.ClientId { get => this._clientId; set { {_clientId = value;} } } /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } /// Backing field for property. private string _principalId; @@ -47,6 +47,9 @@ public partial interface IUserAssignedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The client ID of the assigned identity.", SerializedName = @"clientId", PossibleTypes = new [] { typeof(string) })] @@ -55,6 +58,9 @@ public partial interface IUserAssignedIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal ID of the assigned identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.json.cs index 4914915d504b..4017e3d62afa 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class UserAssignedIdentity 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.Api30.IUserAssignedIdentity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new UserAssignedIdentity(json) : null; } @@ -84,11 +84,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); } @@ -108,8 +108,8 @@ internal UserAssignedIdentity(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsi { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.PowerShell.cs new file mode 100644 index 000000000000..14351744234f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.PowerShell.cs @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights WebTest definition. + [System.ComponentModel.TypeConverter(typeof(WebTestTypeConverter))] + public partial class WebTest + { + + /// + /// 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.IWebTest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebTest(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.IWebTest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebTest(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.IWebTest 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(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WebTest(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.IWebTestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Request")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Request = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest) content.GetValueForProperty("Request",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesRequestTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRule = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules) content.GetValueForProperty("ValidationRule",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRule, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesTypeConverter.ConvertFrom); + } + if (content.Contains("SyntheticMonitorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).SyntheticMonitorId = (string) content.GetValueForProperty("SyntheticMonitorId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).SyntheticMonitorId, global::System.Convert.ToString); + } + if (content.Contains("WebTestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).WebTestName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Frequency = (int?) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Frequency, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Timeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Timeout = (int?) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Timeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WebTestKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).WebTestKind = (string) content.GetValueForProperty("WebTestKind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).WebTestKind, global::System.Convert.ToString); + } + if (content.Contains("RetryEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RetryEnabled = (bool?) content.GetValueForProperty("RetryEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RetryEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Locations")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Locations = (System.Collections.Generic.List) content.GetValueForProperty("Locations",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Locations, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocationTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationWebTest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ConfigurationWebTest = (string) content.GetValueForProperty("ConfigurationWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ConfigurationWebTest, global::System.Convert.ToString); + } + if (content.Contains("RequestUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestUrl, global::System.Convert.ToString); + } + if (content.Contains("RequestHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestHeader = (System.Collections.Generic.List) content.GetValueForProperty("RequestHeader",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestHeader, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestHttpVerb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestHttpVerb = (string) content.GetValueForProperty("RequestHttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestHttpVerb, global::System.Convert.ToString); + } + if (content.Contains("RequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestBody, global::System.Convert.ToString); + } + if (content.Contains("RequestParseDependentRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestParseDependentRequest = (bool?) content.GetValueForProperty("RequestParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RequestFollowRedirect")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestFollowRedirect = (bool?) content.GetValueForProperty("RequestFollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestFollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationRuleContentValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ValidationRuleContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationRuleSslCheck")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleSslCheck = (bool?) content.GetValueForProperty("ValidationRuleSslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleSslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationRuleSslCertRemainingLifetimeCheck")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleSslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("ValidationRuleSslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleSslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ValidationRuleExpectedHttpStatusCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleExpectedHttpStatusCode = (int?) content.GetValueForProperty("ValidationRuleExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ValidationRuleIgnoreHttpsStatusCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleIgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("ValidationRuleIgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleIgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContentValidationContentMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); + } + if (content.Contains("ContentValidationIgnoreCase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContentValidationPassIfTextFound")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationPassIfTextFound, (__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 WebTest(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.IWebTestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Request")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Request = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest) content.GetValueForProperty("Request",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesRequestTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRule = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules) content.GetValueForProperty("ValidationRule",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRule, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesTypeConverter.ConvertFrom); + } + if (content.Contains("SyntheticMonitorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).SyntheticMonitorId = (string) content.GetValueForProperty("SyntheticMonitorId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).SyntheticMonitorId, global::System.Convert.ToString); + } + if (content.Contains("WebTestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).WebTestName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Frequency = (int?) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Frequency, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Timeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Timeout = (int?) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Timeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WebTestKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).WebTestKind = (string) content.GetValueForProperty("WebTestKind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).WebTestKind, global::System.Convert.ToString); + } + if (content.Contains("RetryEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RetryEnabled = (bool?) content.GetValueForProperty("RetryEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RetryEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Locations")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Locations = (System.Collections.Generic.List) content.GetValueForProperty("Locations",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).Locations, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocationTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationWebTest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ConfigurationWebTest = (string) content.GetValueForProperty("ConfigurationWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ConfigurationWebTest, global::System.Convert.ToString); + } + if (content.Contains("RequestUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestUrl, global::System.Convert.ToString); + } + if (content.Contains("RequestHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestHeader = (System.Collections.Generic.List) content.GetValueForProperty("RequestHeader",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestHeader, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestHttpVerb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestHttpVerb = (string) content.GetValueForProperty("RequestHttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestHttpVerb, global::System.Convert.ToString); + } + if (content.Contains("RequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestBody, global::System.Convert.ToString); + } + if (content.Contains("RequestParseDependentRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestParseDependentRequest = (bool?) content.GetValueForProperty("RequestParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RequestFollowRedirect")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestFollowRedirect = (bool?) content.GetValueForProperty("RequestFollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).RequestFollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationRuleContentValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ValidationRuleContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationRuleSslCheck")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleSslCheck = (bool?) content.GetValueForProperty("ValidationRuleSslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleSslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationRuleSslCertRemainingLifetimeCheck")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleSslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("ValidationRuleSslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleSslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ValidationRuleExpectedHttpStatusCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleExpectedHttpStatusCode = (int?) content.GetValueForProperty("ValidationRuleExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ValidationRuleIgnoreHttpsStatusCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleIgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("ValidationRuleIgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ValidationRuleIgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContentValidationContentMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); + } + if (content.Contains("ContentValidationIgnoreCase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContentValidationPassIfTextFound")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal)this).ContentValidationPassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + } + /// An Application Insights WebTest definition. + [System.ComponentModel.TypeConverter(typeof(WebTestTypeConverter))] + public partial interface IWebTest + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.TypeConverter.cs index 6c075cbe4df1..2b5173dd75b0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.cs index ca6e25cdc027..ddbcf71905d0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.cs @@ -3,36 +3,36 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// An Application Insights WebTest definition. public partial class WebTest : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource __webtestsResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource __webtestsResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResource(); /// The XML specification of a WebTest to run against an application. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string ConfigurationWebTest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ConfigurationWebTest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ConfigurationWebTest = value ?? null; } + public string ConfigurationWebTest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ConfigurationWebTest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ConfigurationWebTest = value ?? null; } /// Content to look for in the return of the WebTest. Must not be null or empty. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string ContentValidationContentMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ContentValidationContentMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ContentValidationContentMatch = value ?? null; } + public string ContentValidationContentMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ContentValidationContentMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ContentValidationContentMatch = value ?? null; } /// When set, this value makes the ContentMatch validation case insensitive. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public bool? ContentValidationIgnoreCase { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ContentValidationIgnoreCase; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ContentValidationIgnoreCase = value ?? default(bool); } + public bool? ContentValidationIgnoreCase { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ContentValidationIgnoreCase; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ContentValidationIgnoreCase = value ?? default(bool); } /// /// When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there @@ -40,89 +40,89 @@ public partial class WebTest : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public bool? ContentValidationPassIfTextFound { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ContentValidationPassIfTextFound; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ContentValidationPassIfTextFound = value ?? default(bool); } + public bool? ContentValidationPassIfTextFound { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ContentValidationPassIfTextFound; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ContentValidationPassIfTextFound = value ?? default(bool); } /// User defined description for this WebTest. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Description = value ?? null; } /// Is the test actively being monitored. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 3)] - public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Enabled = value ?? default(bool); } + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Enabled = value ?? default(bool); } /// Interval in seconds between test runs for this WebTest. Default value is 300. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public int? Frequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Frequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Frequency = value ?? default(int); } + public int? Frequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Frequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Frequency = value ?? default(int); } /// Azure resource Id [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind? _kind; + private string _kind; /// /// The kind of WebTest that this web test watches. Choices are ping, multistep and standard. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind? Kind { get => this._kind; set => this._kind = value; } + public string Kind { get => this._kind; set => this._kind = value; } /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 1)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Location = value ; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Location = value ?? null; } + + /// + /// A list of where to physically run the tests from to give global coverage for accessibility of your application. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public System.Collections.Generic.List Locations { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Location = value ?? null /* arrayOf */; } /// Internal Acessors for Configuration - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal.Configuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Configuration = value; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal.Configuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Configuration = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for Request - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal.Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Request = value; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal.Request { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Request; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Request = value ?? null /* model class */; } /// Internal Acessors for ValidationRule - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal.ValidationRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRule = value; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal.ValidationRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRule = value ?? null /* model class */; } /// Internal Acessors for ValidationRuleContentValidation - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestInternal.ValidationRuleContentValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleContentValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleContentValidation = value; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestInternal.ValidationRuleContentValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleContentValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleContentValidation = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Type = value ?? null; } /// Azure resource name [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 0)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Name; } - - /// - /// A list of where to physically run the tests from to give global coverage for accessibility of your application. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] PropertiesLocations { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Location = value ?? null /* arrayOf */; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties _property; /// Metadata describing a web test for an Azure resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestProperties()); set => this._property = value; } /// /// Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users @@ -130,37 +130,37 @@ public partial class WebTest : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ProvisioningState; } /// Base64 encoded string body to send with this web test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string RequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestBody = value ?? null; } + public string RequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestBody = value ?? null; } /// Follow redirects for this web test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public bool? RequestFollowRedirect { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestFollowRedirect; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestFollowRedirect = value ?? default(bool); } + public bool? RequestFollowRedirect { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestFollowRedirect; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestFollowRedirect = value ?? default(bool); } /// List of headers and their values to add to the WebTest call. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestHeader = value ?? null /* arrayOf */; } + public System.Collections.Generic.List RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestHeader; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestHeader = value ?? null /* arrayOf */; } /// Http verb to use for this web test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string RequestHttpVerb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestHttpVerb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestHttpVerb = value ?? null; } + public string RequestHttpVerb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestHttpVerb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestHttpVerb = value ?? null; } /// Parse Dependent request for this WebTest. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public bool? RequestParseDependentRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestParseDependentRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestParseDependentRequest = value ?? default(bool); } + public bool? RequestParseDependentRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestParseDependentRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestParseDependentRequest = value ?? default(bool); } /// Url location to test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string RequestUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RequestUrl = value ?? null; } + public string RequestUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RequestUrl = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] @@ -170,37 +170,37 @@ public partial class WebTest : /// Allow for retries should this WebTest fail. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public bool? RetryEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RetryEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).RetryEnabled = value ?? default(bool); } + public bool? RetryEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RetryEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).RetryEnabled = value ?? default(bool); } /// Unique ID of this WebTest. This is typically the same value as the Name field. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SyntheticMonitorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).SyntheticMonitorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).SyntheticMonitorId = value ?? null; } + public string SyntheticMonitorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).SyntheticMonitorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).SyntheticMonitorId = value ?? null; } /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Tag = value ?? null /* model class */; } /// Seconds until this WebTest will timeout and fail. Default value is 30. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public int? Timeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Timeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).Timeout = value ?? default(int); } + public int? Timeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Timeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).Timeout = value ?? default(int); } /// Azure resource type [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)__webtestsResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)__webtestsResource).Type; } /// Validate that the WebTest returns the http status code provided. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public int? ValidationRuleExpectedHttpStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleExpectedHttpStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleExpectedHttpStatusCode = value ?? default(int); } + public int? ValidationRuleExpectedHttpStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleExpectedHttpStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleExpectedHttpStatusCode = value ?? default(int); } /// When set, validation will ignore the status code. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public bool? ValidationRuleIgnoreHttpsStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleIgnoreHttpsStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleIgnoreHttpsStatusCode = value ?? default(bool); } + public bool? ValidationRuleIgnoreHttpsStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleIgnoreHttpsStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleIgnoreHttpsStatusCode = value ?? default(bool); } /// /// A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck @@ -208,22 +208,22 @@ public partial class WebTest : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public int? ValidationRuleSslCertRemainingLifetimeCheck { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleSslCertRemainingLifetimeCheck; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleSslCertRemainingLifetimeCheck = value ?? default(int); } + public int? ValidationRuleSslCertRemainingLifetimeCheck { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleSslCertRemainingLifetimeCheck; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleSslCertRemainingLifetimeCheck = value ?? default(int); } /// Checks to see if the SSL cert is still valid. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public bool? ValidationRuleSslCheck { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleSslCheck; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).ValidationRuleSslCheck = value ?? default(bool); } + public bool? ValidationRuleSslCheck { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleSslCheck; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).ValidationRuleSslCheck = value ?? default(bool); } /// The kind of web test this is, valid choices are ping, multistep, and standard. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 2)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum? WebTestKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).WebTestKind; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).WebTestKind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum)""); } + public string WebTestKind { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).WebTestKind; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).WebTestKind = value ?? null; } /// User defined name if this WebTest. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string WebTestName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).WebTestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal)Property).WebTestName = value ?? null; } + public string WebTestName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).WebTestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)Property).WebTestName = value ?? null; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -246,12 +246,15 @@ public WebTest() /// An Application Insights WebTest definition. public partial interface IWebTest : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource { /// The XML specification of a WebTest to run against an application. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The XML specification of a WebTest to run against an application.", SerializedName = @"WebTest", PossibleTypes = new [] { typeof(string) })] @@ -260,6 +263,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Content to look for in the return of the WebTest. Must not be null or empty.", SerializedName = @"ContentMatch", PossibleTypes = new [] { typeof(string) })] @@ -268,6 +274,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"When set, this value makes the ContentMatch validation case insensitive.", SerializedName = @"IgnoreCase", PossibleTypes = new [] { typeof(bool) })] @@ -279,6 +288,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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(bool) })] @@ -287,6 +299,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User defined description for this WebTest.", SerializedName = @"Description", PossibleTypes = new [] { typeof(string) })] @@ -295,6 +310,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Is the test actively being monitored.", SerializedName = @"Enabled", PossibleTypes = new [] { typeof(bool) })] @@ -303,6 +321,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Interval in seconds between test runs for this WebTest. Default value is 300.", SerializedName = @"Frequency", PossibleTypes = new [] { typeof(int) })] @@ -313,20 +334,27 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The kind of WebTest that this web test watches. Choices are ping, multistep and standard.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind? Kind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + string Kind { get; set; } /// /// A list of where to physically run the tests from to give global coverage for accessibility of your application. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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.Api20220615.IWebTestGeolocation) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] PropertiesLocations { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation) })] + System.Collections.Generic.List Locations { 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. @@ -334,6 +362,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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) })] @@ -342,6 +373,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Base64 encoded string body to send with this web test.", SerializedName = @"RequestBody", PossibleTypes = new [] { typeof(string) })] @@ -350,6 +384,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Follow redirects for this web test.", SerializedName = @"FollowRedirects", PossibleTypes = new [] { typeof(bool) })] @@ -358,14 +395,20 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of headers and their values to add to the WebTest call.", SerializedName = @"Headers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] RequestHeader { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField) })] + System.Collections.Generic.List RequestHeader { get; set; } /// Http verb to use for this web test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Http verb to use for this web test.", SerializedName = @"HttpVerb", PossibleTypes = new [] { typeof(string) })] @@ -374,6 +417,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parse Dependent request for this WebTest.", SerializedName = @"ParseDependentRequests", PossibleTypes = new [] { typeof(bool) })] @@ -382,6 +428,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Url location to test.", SerializedName = @"RequestUrl", PossibleTypes = new [] { typeof(string) })] @@ -390,6 +439,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow for retries should this WebTest fail.", SerializedName = @"RetryEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -398,6 +450,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Unique ID of this WebTest. This is typically the same value as the Name field.", SerializedName = @"SyntheticMonitorId", PossibleTypes = new [] { typeof(string) })] @@ -406,6 +461,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Seconds until this WebTest will timeout and fail. Default value is 30.", SerializedName = @"Timeout", PossibleTypes = new [] { typeof(int) })] @@ -414,6 +472,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Validate that the WebTest returns the http status code provided.", SerializedName = @"ExpectedHttpStatusCode", PossibleTypes = new [] { typeof(int) })] @@ -422,6 +483,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"When set, validation will ignore the status code.", SerializedName = @"IgnoreHttpsStatusCode", PossibleTypes = new [] { typeof(bool) })] @@ -433,6 +497,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -441,6 +508,9 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Checks to see if the SSL cert is still valid.", SerializedName = @"SSLCheck", PossibleTypes = new [] { typeof(bool) })] @@ -449,14 +519,21 @@ public partial interface IWebTest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum? WebTestKind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + string WebTestKind { get; set; } /// User defined name if this WebTest. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User defined name if this WebTest.", SerializedName = @"Name", PossibleTypes = new [] { typeof(string) })] @@ -465,10 +542,10 @@ public partial interface IWebTest : } /// An Application Insights WebTest definition. internal partial interface IWebTestInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal { /// An XML configuration specification for a WebTest. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration Configuration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration Configuration { get; set; } /// The XML specification of a WebTest to run against an application. string ConfigurationWebTest { get; set; } /// Content to look for in the return of the WebTest. Must not be null or empty. @@ -489,26 +566,27 @@ internal partial interface IWebTestInternal : /// /// The kind of WebTest that this web test watches. Choices are ping, multistep and standard. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind? Kind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + string Kind { get; set; } /// /// A list of where to physically run the tests from to give global coverage for accessibility of your application. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] PropertiesLocations { get; set; } + System.Collections.Generic.List Locations { get; set; } /// Metadata describing a web test for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties 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 collection of request properties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest Request { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest Request { get; set; } /// Base64 encoded string body to send with this web test. string RequestBody { get; set; } /// Follow redirects for this web test. bool? RequestFollowRedirect { get; set; } /// List of headers and their values to add to the WebTest call. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] RequestHeader { get; set; } + System.Collections.Generic.List RequestHeader { get; set; } /// Http verb to use for this web test. string RequestHttpVerb { get; set; } /// Parse Dependent request for this WebTest. @@ -522,9 +600,9 @@ internal partial interface IWebTestInternal : /// Seconds until this WebTest will timeout and fail. Default value is 30. int? Timeout { get; set; } /// The collection of validation rule properties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules ValidationRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules ValidationRule { get; set; } /// The collection of content validation properties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation ValidationRuleContentValidation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation ValidationRuleContentValidation { get; set; } /// Validate that the WebTest returns the http status code provided. int? ValidationRuleExpectedHttpStatusCode { get; set; } /// When set, validation will ignore the status code. @@ -537,7 +615,8 @@ internal partial interface IWebTestInternal : /// Checks to see if the SSL cert is still valid. bool? ValidationRuleSslCheck { get; set; } /// The kind of web test this is, valid choices are ping, multistep, and standard. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum? WebTestKind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + string WebTestKind { get; set; } /// User defined name if this WebTest. string WebTestName { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.json.cs index 49c82d56ca92..ebb0da51fed9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebTest 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.Api20220615.IWebTest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebTest(json) : null; } @@ -103,9 +103,9 @@ internal WebTest(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime. { return; } - __webtestsResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestProperties.FromJson(__jsonProperties) : Property;} - {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + __webtestsResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestProperties.FromJson(__jsonProperties) : _property;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)_kind;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.PowerShell.cs similarity index 84% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.PowerShell.cs index e166fbc4c049..095c881c2a44 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class WebTestGeolocation partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebTestGeolocation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebTestGeolocation(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -117,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -132,13 +130,13 @@ internal WebTestGeolocation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocationInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocationInternal)this).Location, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -153,7 +151,7 @@ internal WebTestGeolocation(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocationInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocationInternal)this).Location, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.TypeConverter.cs index 7e7d8a2d7587..ba2223f43511 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.cs index 667985a7efb0..bca9a423ca70 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220 /// Geo-physical location to run a WebTest from. You must specify one or more locations for the test to run from. /// public partial class WebTestGeolocation : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocationInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocationInternal { /// Backing field for property. @@ -36,6 +36,9 @@ public partial interface IWebTestGeolocation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Location ID for the WebTest to run from.", SerializedName = @"Id", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.json.cs index e60e74fb2cef..ef0e3362caaa 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestGeolocation.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestGeolocation.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class WebTestGeolocation 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.Api20220615.IWebTestGeolocation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebTestGeolocation(json) : null; } @@ -103,7 +103,7 @@ internal WebTestGeolocation(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsigh { return; } - {_location = If( json?.PropertyT("Id"), out var __jsonId) ? (string)__jsonId : (string)Location;} + {_location = If( json?.PropertyT("Id"), out var __jsonId) ? (string)__jsonId : (string)_location;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.PowerShell.cs similarity index 75% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.PowerShell.cs index 3d6a38c489bd..35e2b968511b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WebTestListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebTestListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebTestListResult(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,17 +128,17 @@ internal WebTestListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -155,11 +153,11 @@ internal WebTestListResult(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.TypeConverter.cs index e11b3f1d3f8f..b66d8787b61f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.cs similarity index 80% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.cs index 9b42ff924f10..ff107f33dde8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// A list of 0 or more Application Insights WebTest definitions. public partial class WebTestListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResultInternal { /// Backing field for property. @@ -24,11 +24,11 @@ public partial class WebTestListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest[] _value; + private System.Collections.Generic.List _value; /// Set of Application Insights WebTest definitions. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public WebTestListResult() @@ -47,6 +47,9 @@ public partial interface IWebTestListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link to get the next part of the returned list of WebTest, should the return set be too large for a single request. May be null.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWebTestListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Set of Application Insights WebTest definitions.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest) })] + System.Collections.Generic.List Value { get; set; } } /// A list of 0 or more Application Insights WebTest definitions. @@ -71,7 +77,7 @@ internal partial interface IWebTestListResultInternal /// string NextLink { get; set; } /// Set of Application Insights WebTest definitions. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.json.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.json.cs index 93c84572eef3..d5aa1d3c9dc0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestListResult.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebTestListResult 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.Api20220615.IWebTestListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebTestListResult(json) : null; } @@ -110,8 +110,8 @@ internal WebTestListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsight { 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.Api20220615.IWebTest) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTest.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTest.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.PowerShell.cs new file mode 100644 index 000000000000..a9971267ef4d --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.PowerShell.cs @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Metadata describing a web test for an Azure resource. + [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesTypeConverter))] + public partial class WebTestProperties + { + + /// + /// 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.IWebTestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebTestProperties(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.IWebTestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebTestProperties(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.IWebTestProperties 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(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WebTestProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Request")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Request = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest) content.GetValueForProperty("Request",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesRequestTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRule = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules) content.GetValueForProperty("ValidationRule",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRule, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesTypeConverter.ConvertFrom); + } + if (content.Contains("SyntheticMonitorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).SyntheticMonitorId = (string) content.GetValueForProperty("SyntheticMonitorId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).SyntheticMonitorId, global::System.Convert.ToString); + } + if (content.Contains("WebTestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).WebTestName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Frequency = (int?) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Frequency, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Timeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Timeout = (int?) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Timeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WebTestKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).WebTestKind = (string) content.GetValueForProperty("WebTestKind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).WebTestKind, global::System.Convert.ToString); + } + if (content.Contains("RetryEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RetryEnabled = (bool?) content.GetValueForProperty("RetryEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RetryEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Location = (System.Collections.Generic.List) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Location, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocationTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationWebTest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ConfigurationWebTest = (string) content.GetValueForProperty("ConfigurationWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ConfigurationWebTest, global::System.Convert.ToString); + } + if (content.Contains("RequestUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestUrl, global::System.Convert.ToString); + } + if (content.Contains("RequestHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestHeader = (System.Collections.Generic.List) content.GetValueForProperty("RequestHeader",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestHeader, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestHttpVerb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestHttpVerb = (string) content.GetValueForProperty("RequestHttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestHttpVerb, global::System.Convert.ToString); + } + if (content.Contains("RequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestBody, global::System.Convert.ToString); + } + if (content.Contains("RequestParseDependentRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestParseDependentRequest = (bool?) content.GetValueForProperty("RequestParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RequestFollowRedirect")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestFollowRedirect = (bool?) content.GetValueForProperty("RequestFollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestFollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationRuleContentValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ValidationRuleContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationRuleSslCheck")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleSslCheck = (bool?) content.GetValueForProperty("ValidationRuleSslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleSslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationRuleSslCertRemainingLifetimeCheck")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleSslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("ValidationRuleSslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleSslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ValidationRuleExpectedHttpStatusCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleExpectedHttpStatusCode = (int?) content.GetValueForProperty("ValidationRuleExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ValidationRuleIgnoreHttpsStatusCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleIgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("ValidationRuleIgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleIgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContentValidationContentMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); + } + if (content.Contains("ContentValidationIgnoreCase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContentValidationPassIfTextFound")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationPassIfTextFound, (__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 WebTestProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Request")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Request = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest) content.GetValueForProperty("Request",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Request, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesRequestTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRule = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules) content.GetValueForProperty("ValidationRule",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRule, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesTypeConverter.ConvertFrom); + } + if (content.Contains("SyntheticMonitorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).SyntheticMonitorId = (string) content.GetValueForProperty("SyntheticMonitorId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).SyntheticMonitorId, global::System.Convert.ToString); + } + if (content.Contains("WebTestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).WebTestName = (string) content.GetValueForProperty("WebTestName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).WebTestName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Frequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Frequency = (int?) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Frequency, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Timeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Timeout = (int?) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Timeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WebTestKind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).WebTestKind = (string) content.GetValueForProperty("WebTestKind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).WebTestKind, global::System.Convert.ToString); + } + if (content.Contains("RetryEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RetryEnabled = (bool?) content.GetValueForProperty("RetryEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RetryEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Location = (System.Collections.Generic.List) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).Location, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocationTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationWebTest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ConfigurationWebTest = (string) content.GetValueForProperty("ConfigurationWebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ConfigurationWebTest, global::System.Convert.ToString); + } + if (content.Contains("RequestUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestUrl, global::System.Convert.ToString); + } + if (content.Contains("RequestHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestHeader = (System.Collections.Generic.List) content.GetValueForProperty("RequestHeader",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestHeader, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderFieldTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestHttpVerb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestHttpVerb = (string) content.GetValueForProperty("RequestHttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestHttpVerb, global::System.Convert.ToString); + } + if (content.Contains("RequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestBody, global::System.Convert.ToString); + } + if (content.Contains("RequestParseDependentRequest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestParseDependentRequest = (bool?) content.GetValueForProperty("RequestParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RequestFollowRedirect")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestFollowRedirect = (bool?) content.GetValueForProperty("RequestFollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).RequestFollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationRuleContentValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ValidationRuleContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); + } + if (content.Contains("ValidationRuleSslCheck")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleSslCheck = (bool?) content.GetValueForProperty("ValidationRuleSslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleSslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ValidationRuleSslCertRemainingLifetimeCheck")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleSslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("ValidationRuleSslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleSslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ValidationRuleExpectedHttpStatusCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleExpectedHttpStatusCode = (int?) content.GetValueForProperty("ValidationRuleExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ValidationRuleIgnoreHttpsStatusCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleIgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("ValidationRuleIgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ValidationRuleIgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContentValidationContentMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); + } + if (content.Contains("ContentValidationIgnoreCase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContentValidationPassIfTextFound")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal)this).ContentValidationPassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + } + /// Metadata describing a web test for an Azure resource. + [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesTypeConverter))] + public partial interface IWebTestProperties + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.TypeConverter.cs index b5baf8fe0024..ae342932e492 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.cs similarity index 73% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.cs index a90e9834c5db..0f19e6a1a277 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.cs @@ -3,41 +3,41 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Metadata describing a web test for an Azure resource. public partial class WebTestProperties : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration _configuration; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration _configuration; /// An XML configuration specification for a WebTest. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesConfiguration()); set => this._configuration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesConfiguration()); set => this._configuration = value; } /// The XML specification of a WebTest to run against an application. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string ConfigurationWebTest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfigurationInternal)Configuration).WebTest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfigurationInternal)Configuration).WebTest = value ?? null; } + public string ConfigurationWebTest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfigurationInternal)Configuration).WebTest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfigurationInternal)Configuration).WebTest = value ?? null; } /// Content to look for in the return of the WebTest. Must not be null or empty. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string ContentValidationContentMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationContentMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationContentMatch = value ?? null; } + public string ContentValidationContentMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationContentMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationContentMatch = value ?? null; } /// When set, this value makes the ContentMatch validation case insensitive. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? ContentValidationIgnoreCase { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationIgnoreCase; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationIgnoreCase = value ?? default(bool); } + public bool? ContentValidationIgnoreCase { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationIgnoreCase; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationIgnoreCase = value ?? default(bool); } /// /// When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there /// is a match /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? ContentValidationPassIfTextFound { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationPassIfTextFound; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationPassIfTextFound = value ?? default(bool); } + public bool? ContentValidationPassIfTextFound { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationPassIfTextFound; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationPassIfTextFound = value ?? default(bool); } /// Backing field for property. private string _description; @@ -61,28 +61,28 @@ public partial class WebTestProperties : public int? Frequency { get => this._frequency; set => this._frequency = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] _location; + private System.Collections.Generic.List _location; /// /// A list of where to physically run the tests from to give global coverage for accessibility of your application. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] Location { get => this._location; set => this._location = value; } + public System.Collections.Generic.List Location { get => this._location; set => this._location = value; } /// Internal Acessors for Configuration - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesConfiguration()); set { {_configuration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesConfiguration()); set { {_configuration = value;} } } /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for Request - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal.Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesRequest()); set { {_request = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal.Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesRequest()); set { {_request = value;} } } /// Internal Acessors for ValidationRule - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal.ValidationRule { get => (this._validationRule = this._validationRule ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRules()); set { {_validationRule = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal.ValidationRule { get => (this._validationRule = this._validationRule ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRules()); set { {_validationRule = value;} } } /// Internal Acessors for ValidationRuleContentValidation - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesInternal.ValidationRuleContentValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidation = value; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesInternal.ValidationRuleContentValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidation = value ?? null /* model class */; } /// Backing field for property. private string _provisioningState; @@ -95,35 +95,35 @@ public partial class WebTestProperties : public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest _request; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest _request; /// The collection of request properties [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesRequest()); set => this._request = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest Request { get => (this._request = this._request ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesRequest()); set => this._request = value; } /// Base64 encoded string body to send with this web test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string RequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).RequestBody = value ?? null; } + public string RequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).RequestBody = value ?? null; } /// Follow redirects for this web test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? RequestFollowRedirect { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).FollowRedirect; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).FollowRedirect = value ?? default(bool); } + public bool? RequestFollowRedirect { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).FollowRedirect; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).FollowRedirect = value ?? default(bool); } /// List of headers and their values to add to the WebTest call. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).Header = value ?? null /* arrayOf */; } + public System.Collections.Generic.List RequestHeader { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).Header; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).Header = value ?? null /* arrayOf */; } /// Http verb to use for this web test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string RequestHttpVerb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).HttpVerb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).HttpVerb = value ?? null; } + public string RequestHttpVerb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).HttpVerb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).HttpVerb = value ?? null; } /// Parse Dependent request for this WebTest. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? RequestParseDependentRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).ParseDependentRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).ParseDependentRequest = value ?? default(bool); } + public bool? RequestParseDependentRequest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).ParseDependentRequest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).ParseDependentRequest = value ?? default(bool); } /// Url location to test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string RequestUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).RequestUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)Request).RequestUrl = value ?? null; } + public string RequestUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).RequestUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).RequestUrl = value ?? null; } /// Backing field for property. private bool? _retryEnabled; @@ -147,37 +147,37 @@ public partial class WebTestProperties : public int? Timeout { get => this._timeout; set => this._timeout = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules _validationRule; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules _validationRule; /// The collection of validation rule properties [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules ValidationRule { get => (this._validationRule = this._validationRule ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRules()); set => this._validationRule = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules ValidationRule { get => (this._validationRule = this._validationRule ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRules()); set => this._validationRule = value; } /// Validate that the WebTest returns the http status code provided. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public int? ValidationRuleExpectedHttpStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ExpectedHttpStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).ExpectedHttpStatusCode = value ?? default(int); } + public int? ValidationRuleExpectedHttpStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ExpectedHttpStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ExpectedHttpStatusCode = value ?? default(int); } /// When set, validation will ignore the status code. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? ValidationRuleIgnoreHttpsStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).IgnoreHttpsStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).IgnoreHttpsStatusCode = value ?? default(bool); } + public bool? ValidationRuleIgnoreHttpsStatusCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).IgnoreHttpsStatusCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).IgnoreHttpsStatusCode = value ?? default(bool); } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public int? ValidationRuleSslCertRemainingLifetimeCheck { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCertRemainingLifetimeCheck; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCertRemainingLifetimeCheck = value ?? default(int); } + public int? ValidationRuleSslCertRemainingLifetimeCheck { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCertRemainingLifetimeCheck; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCertRemainingLifetimeCheck = value ?? default(int); } /// Checks to see if the SSL cert is still valid. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? ValidationRuleSslCheck { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCheck; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCheck = value ?? default(bool); } + public bool? ValidationRuleSslCheck { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCheck; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCheck = value ?? default(bool); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum _webTestKind; + private string _webTestKind; /// The kind of web test this is, valid choices are ping, multistep, and standard. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum WebTestKind { get => this._webTestKind; set => this._webTestKind = value; } + public string WebTestKind { get => this._webTestKind; set => this._webTestKind = value; } /// Backing field for property. private string _webTestName; @@ -200,6 +200,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The XML specification of a WebTest to run against an application.", SerializedName = @"WebTest", PossibleTypes = new [] { typeof(string) })] @@ -208,6 +211,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Content to look for in the return of the WebTest. Must not be null or empty.", SerializedName = @"ContentMatch", PossibleTypes = new [] { typeof(string) })] @@ -216,6 +222,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"When set, this value makes the ContentMatch validation case insensitive.", SerializedName = @"IgnoreCase", PossibleTypes = new [] { typeof(bool) })] @@ -227,6 +236,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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(bool) })] @@ -235,6 +247,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User defined description for this WebTest.", SerializedName = @"Description", PossibleTypes = new [] { typeof(string) })] @@ -243,6 +258,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Is the test actively being monitored.", SerializedName = @"Enabled", PossibleTypes = new [] { typeof(bool) })] @@ -251,6 +269,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Interval in seconds between test runs for this WebTest. Default value is 300.", SerializedName = @"Frequency", PossibleTypes = new [] { typeof(int) })] @@ -261,10 +282,13 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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.Api20220615.IWebTestGeolocation) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] Location { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation) })] + System.Collections.Generic.List Location { 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. @@ -272,6 +296,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, 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) })] @@ -280,6 +307,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Base64 encoded string body to send with this web test.", SerializedName = @"RequestBody", PossibleTypes = new [] { typeof(string) })] @@ -288,6 +318,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Follow redirects for this web test.", SerializedName = @"FollowRedirects", PossibleTypes = new [] { typeof(bool) })] @@ -296,14 +329,20 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of headers and their values to add to the WebTest call.", SerializedName = @"Headers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] RequestHeader { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField) })] + System.Collections.Generic.List RequestHeader { get; set; } /// Http verb to use for this web test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Http verb to use for this web test.", SerializedName = @"HttpVerb", PossibleTypes = new [] { typeof(string) })] @@ -312,6 +351,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parse Dependent request for this WebTest.", SerializedName = @"ParseDependentRequests", PossibleTypes = new [] { typeof(bool) })] @@ -320,6 +362,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Url location to test.", SerializedName = @"RequestUrl", PossibleTypes = new [] { typeof(string) })] @@ -328,6 +373,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allow for retries should this WebTest fail.", SerializedName = @"RetryEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -336,6 +384,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Unique ID of this WebTest. This is typically the same value as the Name field.", SerializedName = @"SyntheticMonitorId", PossibleTypes = new [] { typeof(string) })] @@ -344,6 +395,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Seconds until this WebTest will timeout and fail. Default value is 30.", SerializedName = @"Timeout", PossibleTypes = new [] { typeof(int) })] @@ -352,6 +406,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Validate that the WebTest returns the http status code provided.", SerializedName = @"ExpectedHttpStatusCode", PossibleTypes = new [] { typeof(int) })] @@ -360,6 +417,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"When set, validation will ignore the status code.", SerializedName = @"IgnoreHttpsStatusCode", PossibleTypes = new [] { typeof(bool) })] @@ -371,6 +431,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -379,6 +442,9 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Checks to see if the SSL cert is still valid.", SerializedName = @"SSLCheck", PossibleTypes = new [] { typeof(bool) })] @@ -387,14 +453,21 @@ public partial interface IWebTestProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum WebTestKind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + string WebTestKind { get; set; } /// User defined name if this WebTest. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User defined name if this WebTest.", SerializedName = @"Name", PossibleTypes = new [] { typeof(string) })] @@ -406,7 +479,7 @@ internal partial interface IWebTestPropertiesInternal { /// An XML configuration specification for a WebTest. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration Configuration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration Configuration { get; set; } /// The XML specification of a WebTest to run against an application. string ConfigurationWebTest { get; set; } /// Content to look for in the return of the WebTest. Must not be null or empty. @@ -427,20 +500,20 @@ internal partial interface IWebTestPropertiesInternal /// /// A list of where to physically run the tests from to give global coverage for accessibility of your application. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] Location { get; set; } + System.Collections.Generic.List Location { 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 collection of request properties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest Request { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest Request { get; set; } /// Base64 encoded string body to send with this web test. string RequestBody { get; set; } /// Follow redirects for this web test. bool? RequestFollowRedirect { get; set; } /// List of headers and their values to add to the WebTest call. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] RequestHeader { get; set; } + System.Collections.Generic.List RequestHeader { get; set; } /// Http verb to use for this web test. string RequestHttpVerb { get; set; } /// Parse Dependent request for this WebTest. @@ -454,9 +527,9 @@ internal partial interface IWebTestPropertiesInternal /// Seconds until this WebTest will timeout and fail. Default value is 30. int? Timeout { get; set; } /// The collection of validation rule properties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules ValidationRule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules ValidationRule { get; set; } /// The collection of content validation properties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation ValidationRuleContentValidation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation ValidationRuleContentValidation { get; set; } /// Validate that the WebTest returns the http status code provided. int? ValidationRuleExpectedHttpStatusCode { get; set; } /// When set, validation will ignore the status code. @@ -469,7 +542,8 @@ internal partial interface IWebTestPropertiesInternal /// Checks to see if the SSL cert is still valid. bool? ValidationRuleSslCheck { get; set; } /// The kind of web test this is, valid choices are ping, multistep, and standard. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum WebTestKind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + string WebTestKind { get; set; } /// User defined name if this WebTest. string WebTestName { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.json.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.json.cs index b67168e2c17b..56f1bd4b6256 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebTestProperties 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.Api20220615.IWebTestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebTestProperties(json) : null; } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN } container.Add("Locations",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } @@ -124,19 +124,19 @@ internal WebTestProperties(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsight { return; } - {_configuration = If( json?.PropertyT("Configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesConfiguration.FromJson(__jsonConfiguration) : Configuration;} - {_request = If( json?.PropertyT("Request"), out var __jsonRequest) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesRequest.FromJson(__jsonRequest) : Request;} - {_validationRule = If( json?.PropertyT("ValidationRules"), out var __jsonValidationRules) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRules.FromJson(__jsonValidationRules) : ValidationRule;} - {_syntheticMonitorId = If( json?.PropertyT("SyntheticMonitorId"), out var __jsonSyntheticMonitorId) ? (string)__jsonSyntheticMonitorId : (string)SyntheticMonitorId;} - {_webTestName = If( json?.PropertyT("Name"), out var __jsonName) ? (string)__jsonName : (string)WebTestName;} - {_description = If( json?.PropertyT("Description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_enabled = If( json?.PropertyT("Enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} - {_frequency = If( json?.PropertyT("Frequency"), out var __jsonFrequency) ? (int?)__jsonFrequency : Frequency;} - {_timeout = If( json?.PropertyT("Timeout"), out var __jsonTimeout) ? (int?)__jsonTimeout : Timeout;} - {_webTestKind = If( json?.PropertyT("Kind"), out var __jsonKind) ? (string)__jsonKind : (string)WebTestKind;} - {_retryEnabled = If( json?.PropertyT("RetryEnabled"), out var __jsonRetryEnabled) ? (bool?)__jsonRetryEnabled : RetryEnabled;} - {_location = If( json?.PropertyT("Locations"), out var __jsonLocations) ? If( __jsonLocations 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.Api20220615.IWebTestGeolocation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestGeolocation.FromJson(__u) )) ))() : null : Location;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_configuration = If( json?.PropertyT("Configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesConfiguration.FromJson(__jsonConfiguration) : _configuration;} + {_request = If( json?.PropertyT("Request"), out var __jsonRequest) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesRequest.FromJson(__jsonRequest) : _request;} + {_validationRule = If( json?.PropertyT("ValidationRules"), out var __jsonValidationRules) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRules.FromJson(__jsonValidationRules) : _validationRule;} + {_syntheticMonitorId = If( json?.PropertyT("SyntheticMonitorId"), out var __jsonSyntheticMonitorId) ? (string)__jsonSyntheticMonitorId : (string)_syntheticMonitorId;} + {_webTestName = If( json?.PropertyT("Name"), out var __jsonName) ? (string)__jsonName : (string)_webTestName;} + {_description = If( json?.PropertyT("Description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_enabled = If( json?.PropertyT("Enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} + {_frequency = If( json?.PropertyT("Frequency"), out var __jsonFrequency) ? (int?)__jsonFrequency : _frequency;} + {_timeout = If( json?.PropertyT("Timeout"), out var __jsonTimeout) ? (int?)__jsonTimeout : _timeout;} + {_webTestKind = If( json?.PropertyT("Kind"), out var __jsonKind) ? (string)__jsonKind : (string)_webTestKind;} + {_retryEnabled = If( json?.PropertyT("RetryEnabled"), out var __jsonRetryEnabled) ? (bool?)__jsonRetryEnabled : _retryEnabled;} + {_location = If( json?.PropertyT("Locations"), out var __jsonLocations) ? If( __jsonLocations as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestGeolocation.FromJson(__u) )) ))() : null : _location;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.PowerShell.cs similarity index 83% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.PowerShell.cs index 7e5e798090b3..bf1b34242f57 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WebTestPropertiesConfiguration partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20220615.IWebTestPropertiesConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebTestPropertiesConfiguration(content); } /// - /// Deserializes a into an instance of 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.Api20220615.IWebTestPropertiesConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebTestPropertiesConfiguration(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,13 +130,13 @@ internal WebTestPropertiesConfiguration(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("WebTest")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfigurationInternal)this).WebTest = (string) content.GetValueForProperty("WebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfigurationInternal)this).WebTest, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfigurationInternal)this).WebTest = (string) content.GetValueForProperty("WebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfigurationInternal)this).WebTest, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -151,7 +151,7 @@ internal WebTestPropertiesConfiguration(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("WebTest")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfigurationInternal)this).WebTest = (string) content.GetValueForProperty("WebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfigurationInternal)this).WebTest, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfigurationInternal)this).WebTest = (string) content.GetValueForProperty("WebTest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfigurationInternal)this).WebTest, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.TypeConverter.cs index 73b98e9aacca..1f7f16bbd1f4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.cs index a670f12308fd..dc6e8ada0591 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// An XML configuration specification for a WebTest. public partial class WebTestPropertiesConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfigurationInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IWebTestPropertiesConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The XML specification of a WebTest to run against an application.", SerializedName = @"WebTest", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.json.cs index 833b0c24656c..296398ce7887 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesConfiguration.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesConfiguration.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebTestPropertiesConfiguration 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.Api20220615.IWebTestPropertiesConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebTestPropertiesConfiguration(json) : null; } @@ -101,7 +101,7 @@ internal WebTestPropertiesConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Appli { return; } - {_webTest = If( json?.PropertyT("WebTest"), out var __jsonWebTest) ? (string)__jsonWebTest : (string)WebTest;} + {_webTest = If( json?.PropertyT("WebTest"), out var __jsonWebTest) ? (string)__jsonWebTest : (string)_webTest;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.PowerShell.cs similarity index 63% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.PowerShell.cs index 9164f813b102..1b08b82e6804 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WebTestPropertiesRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebTestPropertiesRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebTestPropertiesRequest(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,33 +128,33 @@ internal WebTestPropertiesRequest(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("RequestUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).RequestUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).RequestUrl, global::System.Convert.ToString); } if (content.Contains("Header")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).Header = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).Header, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderFieldTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).Header = (System.Collections.Generic.List) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).Header, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderFieldTypeConverter.ConvertFrom)); } if (content.Contains("HttpVerb")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).HttpVerb = (string) content.GetValueForProperty("HttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).HttpVerb, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).HttpVerb = (string) content.GetValueForProperty("HttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).HttpVerb, global::System.Convert.ToString); } if (content.Contains("RequestBody")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).RequestBody, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).RequestBody, global::System.Convert.ToString); } if (content.Contains("ParseDependentRequest")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).ParseDependentRequest = (bool?) content.GetValueForProperty("ParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).ParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).ParseDependentRequest = (bool?) content.GetValueForProperty("ParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).ParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("FollowRedirect")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).FollowRedirect = (bool?) content.GetValueForProperty("FollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).FollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).FollowRedirect = (bool?) content.GetValueForProperty("FollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).FollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -171,27 +169,27 @@ internal WebTestPropertiesRequest(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("RequestUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).RequestUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).RequestUrl = (string) content.GetValueForProperty("RequestUrl",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).RequestUrl, global::System.Convert.ToString); } if (content.Contains("Header")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).Header = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).Header, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderFieldTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).Header = (System.Collections.Generic.List) content.GetValueForProperty("Header",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).Header, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderFieldTypeConverter.ConvertFrom)); } if (content.Contains("HttpVerb")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).HttpVerb = (string) content.GetValueForProperty("HttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).HttpVerb, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).HttpVerb = (string) content.GetValueForProperty("HttpVerb",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).HttpVerb, global::System.Convert.ToString); } if (content.Contains("RequestBody")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).RequestBody, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).RequestBody = (string) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).RequestBody, global::System.Convert.ToString); } if (content.Contains("ParseDependentRequest")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).ParseDependentRequest = (bool?) content.GetValueForProperty("ParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).ParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).ParseDependentRequest = (bool?) content.GetValueForProperty("ParseDependentRequest",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).ParseDependentRequest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("FollowRedirect")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).FollowRedirect = (bool?) content.GetValueForProperty("FollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal)this).FollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).FollowRedirect = (bool?) content.GetValueForProperty("FollowRedirect",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)this).FollowRedirect, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.TypeConverter.cs index d1e18acdc00f..bb87c9770dd7 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.cs similarity index 85% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.cs index 873026f58406..23d2769ddb0a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// The collection of request properties public partial class WebTestPropertiesRequest : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class WebTestPropertiesRequest : public bool? FollowRedirect { get => this._followRedirect; set => this._followRedirect = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] _header; + private System.Collections.Generic.List _header; /// List of headers and their values to add to the WebTest call. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] Header { get => this._header; set => this._header = value; } + public System.Collections.Generic.List Header { get => this._header; set => this._header = value; } /// Backing field for property. private string _httpVerb; @@ -69,6 +69,9 @@ public partial interface IWebTestPropertiesRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Follow redirects for this web test.", SerializedName = @"FollowRedirects", PossibleTypes = new [] { typeof(bool) })] @@ -77,14 +80,20 @@ public partial interface IWebTestPropertiesRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of headers and their values to add to the WebTest call.", SerializedName = @"Headers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] Header { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField) })] + System.Collections.Generic.List Header { get; set; } /// Http verb to use for this web test. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Http verb to use for this web test.", SerializedName = @"HttpVerb", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +102,9 @@ public partial interface IWebTestPropertiesRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parse Dependent request for this WebTest.", SerializedName = @"ParseDependentRequests", PossibleTypes = new [] { typeof(bool) })] @@ -101,6 +113,9 @@ public partial interface IWebTestPropertiesRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Base64 encoded string body to send with this web test.", SerializedName = @"RequestBody", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +124,9 @@ public partial interface IWebTestPropertiesRequest : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Url location to test.", SerializedName = @"RequestUrl", PossibleTypes = new [] { typeof(string) })] @@ -122,7 +140,7 @@ internal partial interface IWebTestPropertiesRequestInternal /// Follow redirects for this web test. bool? FollowRedirect { get; set; } /// List of headers and their values to add to the WebTest call. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] Header { get; set; } + System.Collections.Generic.List Header { get; set; } /// Http verb to use for this web test. string HttpVerb { get; set; } /// Parse Dependent request for this WebTest. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.json.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.json.cs index 3e569c1744ab..d2200707cd82 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebTestPropertiesRequest 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.Api20220615.IWebTestPropertiesRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebTestPropertiesRequest(json) : null; } @@ -114,12 +114,12 @@ internal WebTestPropertiesRequest(Microsoft.Azure.PowerShell.Cmdlets.Application { return; } - {_requestUrl = If( json?.PropertyT("RequestUrl"), out var __jsonRequestUrl) ? (string)__jsonRequestUrl : (string)RequestUrl;} - {_header = If( json?.PropertyT("Headers"), out var __jsonHeaders) ? If( __jsonHeaders 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.Api20220615.IHeaderField) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.HeaderField.FromJson(__u) )) ))() : null : Header;} - {_httpVerb = If( json?.PropertyT("HttpVerb"), out var __jsonHttpVerb) ? (string)__jsonHttpVerb : (string)HttpVerb;} - {_requestBody = If( json?.PropertyT("RequestBody"), out var __jsonRequestBody) ? (string)__jsonRequestBody : (string)RequestBody;} - {_parseDependentRequest = If( json?.PropertyT("ParseDependentRequests"), out var __jsonParseDependentRequests) ? (bool?)__jsonParseDependentRequests : ParseDependentRequest;} - {_followRedirect = If( json?.PropertyT("FollowRedirects"), out var __jsonFollowRedirects) ? (bool?)__jsonFollowRedirects : FollowRedirect;} + {_requestUrl = If( json?.PropertyT("RequestUrl"), out var __jsonRequestUrl) ? (string)__jsonRequestUrl : (string)_requestUrl;} + {_header = If( json?.PropertyT("Headers"), out var __jsonHeaders) ? If( __jsonHeaders as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.HeaderField.FromJson(__u) )) ))() : null : _header;} + {_httpVerb = If( json?.PropertyT("HttpVerb"), out var __jsonHttpVerb) ? (string)__jsonHttpVerb : (string)_httpVerb;} + {_requestBody = If( json?.PropertyT("RequestBody"), out var __jsonRequestBody) ? (string)__jsonRequestBody : (string)_requestBody;} + {_parseDependentRequest = If( json?.PropertyT("ParseDependentRequests"), out var __jsonParseDependentRequests) ? (bool?)__jsonParseDependentRequests : _parseDependentRequest;} + {_followRedirect = If( json?.PropertyT("FollowRedirects"), out var __jsonFollowRedirects) ? (bool?)__jsonFollowRedirects : _followRedirect;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.PowerShell.cs similarity index 57% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.PowerShell.cs index 55edc55e24bc..4e2736ef7709 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WebTestPropertiesValidationRules partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20220615.IWebTestPropertiesValidationRules DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebTestPropertiesValidationRules(content); } /// - /// Deserializes a into an instance of 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.Api20220615.IWebTestPropertiesValidationRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebTestPropertiesValidationRules(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,41 +130,41 @@ internal WebTestPropertiesValidationRules(global::System.Collections.IDictionary // actually deserialize if (content.Contains("ContentValidation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); } if (content.Contains("SslCheck")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).SslCheck = (bool?) content.GetValueForProperty("SslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).SslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).SslCheck = (bool?) content.GetValueForProperty("SslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).SslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SslCertRemainingLifetimeCheck")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).SslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("SslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).SslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).SslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("SslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).SslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ExpectedHttpStatusCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ExpectedHttpStatusCode = (int?) content.GetValueForProperty("ExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ExpectedHttpStatusCode = (int?) content.GetValueForProperty("ExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("IgnoreHttpsStatusCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).IgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("IgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).IgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).IgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("IgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).IgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ContentValidationContentMatch")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); } if (content.Contains("ContentValidationIgnoreCase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ContentValidationPassIfTextFound")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationPassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationPassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -179,35 +179,35 @@ internal WebTestPropertiesValidationRules(global::System.Management.Automation.P // actually deserialize if (content.Contains("ContentValidation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidation = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation) content.GetValueForProperty("ContentValidation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidation, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidationTypeConverter.ConvertFrom); } if (content.Contains("SslCheck")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).SslCheck = (bool?) content.GetValueForProperty("SslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).SslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).SslCheck = (bool?) content.GetValueForProperty("SslCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).SslCheck, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SslCertRemainingLifetimeCheck")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).SslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("SslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).SslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).SslCertRemainingLifetimeCheck = (int?) content.GetValueForProperty("SslCertRemainingLifetimeCheck",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).SslCertRemainingLifetimeCheck, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ExpectedHttpStatusCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ExpectedHttpStatusCode = (int?) content.GetValueForProperty("ExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ExpectedHttpStatusCode = (int?) content.GetValueForProperty("ExpectedHttpStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ExpectedHttpStatusCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("IgnoreHttpsStatusCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).IgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("IgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).IgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).IgnoreHttpsStatusCode = (bool?) content.GetValueForProperty("IgnoreHttpsStatusCode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).IgnoreHttpsStatusCode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ContentValidationContentMatch")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationContentMatch = (string) content.GetValueForProperty("ContentValidationContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationContentMatch, global::System.Convert.ToString); } if (content.Contains("ContentValidationIgnoreCase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationIgnoreCase = (bool?) content.GetValueForProperty("ContentValidationIgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationIgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ContentValidationPassIfTextFound")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal)this).ContentValidationPassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationPassIfTextFound = (bool?) content.GetValueForProperty("ContentValidationPassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)this).ContentValidationPassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.TypeConverter.cs index 68bb6432c3aa..615d791a96ed 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.cs similarity index 80% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.cs index d39f9d128ba0..5c67bdfea75f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.cs @@ -3,37 +3,37 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// The collection of validation rule properties public partial class WebTestPropertiesValidationRules : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation _contentValidation; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation _contentValidation; /// The collection of content validation properties [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation ContentValidation { get => (this._contentValidation = this._contentValidation ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidation()); set => this._contentValidation = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation ContentValidation { get => (this._contentValidation = this._contentValidation ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidation()); set => this._contentValidation = value; } /// Content to look for in the return of the WebTest. Must not be null or empty. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string ContentValidationContentMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).ContentMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).ContentMatch = value ?? null; } + public string ContentValidationContentMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).ContentMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).ContentMatch = value ?? null; } /// When set, this value makes the ContentMatch validation case insensitive. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? ContentValidationIgnoreCase { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).IgnoreCase; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).IgnoreCase = value ?? default(bool); } + public bool? ContentValidationIgnoreCase { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).IgnoreCase; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).IgnoreCase = value ?? default(bool); } /// /// When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there /// is a match /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? ContentValidationPassIfTextFound { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).PassIfTextFound; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).PassIfTextFound = value ?? default(bool); } + public bool? ContentValidationPassIfTextFound { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).PassIfTextFound; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)ContentValidation).PassIfTextFound = value ?? default(bool); } /// Backing field for property. private int? _expectedHttpStatusCode; @@ -50,7 +50,7 @@ public partial class WebTestPropertiesValidationRules : public bool? IgnoreHttpsStatusCode { get => this._ignoreHttpsStatusCode; set => this._ignoreHttpsStatusCode = value; } /// Internal Acessors for ContentValidation - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesInternal.ContentValidation { get => (this._contentValidation = this._contentValidation ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidation()); set { {_contentValidation = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal.ContentValidation { get => (this._contentValidation = this._contentValidation ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidation()); set { {_contentValidation = value;} } } /// Backing field for property. private int? _sslCertRemainingLifetimeCheck; @@ -83,6 +83,9 @@ public partial interface IWebTestPropertiesValidationRules : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Content to look for in the return of the WebTest. Must not be null or empty.", SerializedName = @"ContentMatch", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +94,9 @@ public partial interface IWebTestPropertiesValidationRules : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"When set, this value makes the ContentMatch validation case insensitive.", SerializedName = @"IgnoreCase", PossibleTypes = new [] { typeof(bool) })] @@ -102,6 +108,9 @@ public partial interface IWebTestPropertiesValidationRules : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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(bool) })] @@ -110,6 +119,9 @@ public partial interface IWebTestPropertiesValidationRules : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Validate that the WebTest returns the http status code provided.", SerializedName = @"ExpectedHttpStatusCode", PossibleTypes = new [] { typeof(int) })] @@ -118,6 +130,9 @@ public partial interface IWebTestPropertiesValidationRules : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"When set, validation will ignore the status code.", SerializedName = @"IgnoreHttpsStatusCode", PossibleTypes = new [] { typeof(bool) })] @@ -129,6 +144,9 @@ public partial interface IWebTestPropertiesValidationRules : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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) })] @@ -137,6 +155,9 @@ public partial interface IWebTestPropertiesValidationRules : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Checks to see if the SSL cert is still valid.", SerializedName = @"SSLCheck", PossibleTypes = new [] { typeof(bool) })] @@ -148,7 +169,7 @@ internal partial interface IWebTestPropertiesValidationRulesInternal { /// The collection of content validation properties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation ContentValidation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation ContentValidation { get; set; } /// Content to look for in the return of the WebTest. Must not be null or empty. string ContentValidationContentMatch { get; set; } /// When set, this value makes the ContentMatch validation case insensitive. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.json.cs similarity index 92% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.json.cs index a77ea8f6ea77..d88dd76e1d3b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebTestPropertiesValidationRules 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.Api20220615.IWebTestPropertiesValidationRules. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebTestPropertiesValidationRules(json) : null; } @@ -105,11 +105,11 @@ internal WebTestPropertiesValidationRules(Microsoft.Azure.PowerShell.Cmdlets.App { return; } - {_contentValidation = If( json?.PropertyT("ContentValidation"), out var __jsonContentValidation) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTestPropertiesValidationRulesContentValidation.FromJson(__jsonContentValidation) : ContentValidation;} - {_sslCheck = If( json?.PropertyT("SSLCheck"), out var __jsonSslCheck) ? (bool?)__jsonSslCheck : SslCheck;} - {_sslCertRemainingLifetimeCheck = If( json?.PropertyT("SSLCertRemainingLifetimeCheck"), out var __jsonSslCertRemainingLifetimeCheck) ? (int?)__jsonSslCertRemainingLifetimeCheck : SslCertRemainingLifetimeCheck;} - {_expectedHttpStatusCode = If( json?.PropertyT("ExpectedHttpStatusCode"), out var __jsonExpectedHttpStatusCode) ? (int?)__jsonExpectedHttpStatusCode : ExpectedHttpStatusCode;} - {_ignoreHttpsStatusCode = If( json?.PropertyT("IgnoreHttpsStatusCode"), out var __jsonIgnoreHttpsStatusCode) ? (bool?)__jsonIgnoreHttpsStatusCode : IgnoreHttpsStatusCode;} + {_contentValidation = If( json?.PropertyT("ContentValidation"), out var __jsonContentValidation) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebTestPropertiesValidationRulesContentValidation.FromJson(__jsonContentValidation) : _contentValidation;} + {_sslCheck = If( json?.PropertyT("SSLCheck"), out var __jsonSslCheck) ? (bool?)__jsonSslCheck : _sslCheck;} + {_sslCertRemainingLifetimeCheck = If( json?.PropertyT("SSLCertRemainingLifetimeCheck"), out var __jsonSslCertRemainingLifetimeCheck) ? (int?)__jsonSslCertRemainingLifetimeCheck : _sslCertRemainingLifetimeCheck;} + {_expectedHttpStatusCode = If( json?.PropertyT("ExpectedHttpStatusCode"), out var __jsonExpectedHttpStatusCode) ? (int?)__jsonExpectedHttpStatusCode : _expectedHttpStatusCode;} + {_ignoreHttpsStatusCode = If( json?.PropertyT("IgnoreHttpsStatusCode"), out var __jsonIgnoreHttpsStatusCode) ? (bool?)__jsonIgnoreHttpsStatusCode : _ignoreHttpsStatusCode;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs similarity index 72% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs index 43c24070eb9b..7dcdafc5252a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WebTestPropertiesValidationRulesContentValidation partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20220615.IWebTestPropertiesValidationRulesContentValidation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebTestPropertiesValidationRulesContentValidation(content); } /// - /// Deserializes a into an instance of 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.Api20220615.IWebTestPropertiesValidationRulesContentValidation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebTestPropertiesValidationRulesContentValidation(content); } @@ -98,7 +98,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -118,7 +118,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -133,21 +133,21 @@ internal WebTestPropertiesValidationRulesContentValidation(global::System.Collec // actually deserialize if (content.Contains("ContentMatch")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).ContentMatch = (string) content.GetValueForProperty("ContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).ContentMatch, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).ContentMatch = (string) content.GetValueForProperty("ContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).ContentMatch, global::System.Convert.ToString); } if (content.Contains("IgnoreCase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).IgnoreCase = (bool?) content.GetValueForProperty("IgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).IgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).IgnoreCase = (bool?) content.GetValueForProperty("IgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).IgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("PassIfTextFound")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).PassIfTextFound = (bool?) content.GetValueForProperty("PassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).PassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).PassIfTextFound = (bool?) content.GetValueForProperty("PassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).PassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -162,15 +162,15 @@ internal WebTestPropertiesValidationRulesContentValidation(global::System.Manage // actually deserialize if (content.Contains("ContentMatch")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).ContentMatch = (string) content.GetValueForProperty("ContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).ContentMatch, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).ContentMatch = (string) content.GetValueForProperty("ContentMatch",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).ContentMatch, global::System.Convert.ToString); } if (content.Contains("IgnoreCase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).IgnoreCase = (bool?) content.GetValueForProperty("IgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).IgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).IgnoreCase = (bool?) content.GetValueForProperty("IgnoreCase",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).IgnoreCase, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("PassIfTextFound")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).PassIfTextFound = (bool?) content.GetValueForProperty("PassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal)this).PassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).PassIfTextFound = (bool?) content.GetValueForProperty("PassIfTextFound",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal)this).PassIfTextFound, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs index 5cc085ba984b..e4e1a704b3d3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.cs index 486e91861984..efb1a3dbc587 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// The collection of content validation properties public partial class WebTestPropertiesValidationRulesContentValidation : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidationInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidationInternal { /// Backing field for property. @@ -53,6 +53,9 @@ public partial interface IWebTestPropertiesValidationRulesContentValidation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Content to look for in the return of the WebTest. Must not be null or empty.", SerializedName = @"ContentMatch", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IWebTestPropertiesValidationRulesContentValidation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"When set, this value makes the ContentMatch validation case insensitive.", SerializedName = @"IgnoreCase", PossibleTypes = new [] { typeof(bool) })] @@ -72,6 +78,9 @@ public partial interface IWebTestPropertiesValidationRulesContentValidation : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, 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(bool) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.json.cs index cf5b1c4fa1af..73880e6e14a3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebTestPropertiesValidationRulesContentValidation 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.Api20220615.IWebTestPropertiesValidationRulesContentValidation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestPropertiesValidationRulesContentValidation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesContentValidation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebTestPropertiesValidationRulesContentValidation(json) : null; } @@ -106,9 +106,9 @@ internal WebTestPropertiesValidationRulesContentValidation(Microsoft.Azure.Power { return; } - {_contentMatch = If( json?.PropertyT("ContentMatch"), out var __jsonContentMatch) ? (string)__jsonContentMatch : (string)ContentMatch;} - {_ignoreCase = If( json?.PropertyT("IgnoreCase"), out var __jsonIgnoreCase) ? (bool?)__jsonIgnoreCase : IgnoreCase;} - {_passIfTextFound = If( json?.PropertyT("PassIfTextFound"), out var __jsonPassIfTextFound) ? (bool?)__jsonPassIfTextFound : PassIfTextFound;} + {_contentMatch = If( json?.PropertyT("ContentMatch"), out var __jsonContentMatch) ? (string)__jsonContentMatch : (string)_contentMatch;} + {_ignoreCase = If( json?.PropertyT("IgnoreCase"), out var __jsonIgnoreCase) ? (bool?)__jsonIgnoreCase : _ignoreCase;} + {_passIfTextFound = If( json?.PropertyT("PassIfTextFound"), out var __jsonPassIfTextFound) ? (bool?)__jsonPassIfTextFound : _passIfTextFound;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.PowerShell.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.PowerShell.cs index 3d49a234240a..2e0dbb919338 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WebtestsResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebtestsResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebtestsResource(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,29 +128,29 @@ internal WebtestsResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResourceTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -167,23 +165,23 @@ internal WebtestsResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResourceTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.TypeConverter.cs index e3179aa88ab5..ba769848b265 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.cs similarity index 83% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.cs index 761d3b8be012..4b15ca3e2335 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// An azure resource object public partial class WebtestsResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal { /// Backing field for property. @@ -28,13 +28,13 @@ public partial class WebtestsResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -44,11 +44,11 @@ public partial class WebtestsResource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -71,14 +71,20 @@ public partial interface IWebtestsResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource Id", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] string Id { get; } /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -87,6 +93,9 @@ public partial interface IWebtestsResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource name", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -95,14 +104,20 @@ public partial interface IWebtestsResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags Tag { get; set; } /// Azure resource type [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource type", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -120,7 +135,7 @@ internal partial interface IWebtestsResourceInternal /// Azure resource name string Name { get; set; } /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags Tag { get; set; } /// Azure resource type string Type { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.json.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.json.cs index 619ac9adbdc5..a29c5a662667 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebtestsResource 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.Api20220615.IWebtestsResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebtestsResource(json) : null; } @@ -84,19 +84,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate)) + { + 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; @@ -114,11 +117,11 @@ internal WebtestsResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights { 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.Api20220615.WebtestsResourceTags.FromJson(__jsonTags) : Tag;} + {_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.WebtestsResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.PowerShell.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.PowerShell.cs index 7b2d09322c95..7ca012dacf57 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WebtestsResourceTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebtestsResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebtestsResourceTags(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -134,7 +132,7 @@ internal WebtestsResourceTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.TypeConverter.cs index b39a58eb6881..bc1cc8ccde19 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.cs index 3ed9f4086fd9..e4ab0720efc6 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Resource tags public partial class WebtestsResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTagsInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.dictionary.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.dictionary.cs index 998bea9f37af..2bcf0740eadb 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebtestsResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WebtestsResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.json.cs index 693f5362f917..9411590000d0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResourceTags.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220615 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebtestsResourceTags 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.Api20220615.IWebtestsResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WebtestsResourceTags(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.PowerShell.cs new file mode 100644 index 000000000000..2f2b379f0509 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.PowerShell.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.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// A workbook definition. + [System.ComponentModel.TypeConverter(typeof(WorkbookTypeConverter))] + public partial class Workbook + { + + /// + /// 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.IWorkbook DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Workbook(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.IWorkbook DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Workbook(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.IWorkbook 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(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Workbook(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.IWorkbookInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("SerializedData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SerializedData, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("TimeModified")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).TimeModified = (global::System.DateTime?) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).TimeModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("PropertiesTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).PropertiesTag = (System.Collections.Generic.List) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).UserId, global::System.Convert.ToString); + } + if (content.Contains("SourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SourceId, global::System.Convert.ToString); + } + if (content.Contains("StorageUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).StorageUri, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Revision, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedAt, (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 Workbook(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.IWorkbookInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("SerializedData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SerializedData, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("TimeModified")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).TimeModified = (global::System.DateTime?) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).TimeModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("PropertiesTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).PropertiesTag = (System.Collections.Generic.List) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).UserId, global::System.Convert.ToString); + } + if (content.Contains("SourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SourceId, global::System.Convert.ToString); + } + if (content.Contains("StorageUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).StorageUri, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).Revision, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// A workbook definition. + [System.ComponentModel.TypeConverter(typeof(WorkbookTypeConverter))] + public partial interface IWorkbook + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.TypeConverter.cs index a09ce97fc60b..359e49a18871 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.cs similarity index 64% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.cs index c40f0edb19fd..4e31a3f3ae70 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.cs @@ -3,74 +3,74 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// A workbook definition. public partial class Workbook : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource __workbookResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource __workbookResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResource(); /// Workbook category, as defined by the user at creation time. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 5)] - public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Category = value ?? null; } + public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Category = value ?? null; } /// The description of the workbook. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Description = value ?? null; } /// The user-defined name (display name) of the workbook. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 2)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).DisplayName = value ?? null; } /// Resource etag [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).Etag = value ?? null; } + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).Etag = value ?? null; } /// /// 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)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__workbookResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__workbookResource).Id; } /// Identity used for BYOS [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).Identity = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).Identity = value ?? null /* model class */; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityPrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityPrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityTenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityTenantId; } /// /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityType = value ?? null; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -79,65 +79,86 @@ public partial class Workbook : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityUserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityUserAssignedIdentity = value ?? null /* model class */; } /// The kind of workbook. Only valid value is shared. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 4)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind? Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).Kind = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind)""); } + public string Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).Kind = value ?? null; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 3)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)__workbookResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)__workbookResource).Location = value ; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)__workbookResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)__workbookResource).Location = 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)__workbookResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__workbookResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__workbookResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__workbookResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__workbookResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__workbookResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__workbookResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__workbookResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__workbookResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__workbookResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__workbookResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__workbookResource).Type = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookProperties()); set { {_property = value;} } } /// Internal Acessors for Revision - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal.Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Revision = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Revision = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for TimeModified - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal.TimeModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).TimeModified; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).TimeModified = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.TimeModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).TimeModified; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).TimeModified = value ?? default(global::System.DateTime); } /// Internal Acessors for UserId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInternal.UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).UserId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInternal.UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).UserId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).UserId = value ?? null; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).Identity = value ?? null /* model class */; } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityPrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityPrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)__workbookResource).IdentityTenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)__workbookResource).IdentityTenantId = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__workbookResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__workbookResource).Name; } /// Being deprecated, please use the other tags field [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string[] PropertiesTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Tag = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PropertiesTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Tag = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties _property; /// Metadata describing a workbook for an Azure resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] @@ -147,93 +168,93 @@ public partial class Workbook : /// The unique revision id for this workbook definition [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Revision; } + public string Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Revision; } /// /// Configuration of this particular workbook. Configuration data is a string containing valid JSON /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SerializedData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).SerializedData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).SerializedData = value ?? null; } + public string SerializedData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).SerializedData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).SerializedData = value ?? null; } /// ResourceId for a source resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).SourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).SourceId = value ?? null; } + public string SourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).SourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).SourceId = value ?? null; } /// The resourceId to the storage account when bring your own storage is used [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string StorageUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).StorageUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).StorageUri = value ?? null; } + public string StorageUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).StorageUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).StorageUri = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)__workbookResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)__workbookResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)__workbookResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)__workbookResource).Tag = value ?? null /* model class */; } /// /// Date and time in UTC of the last modification that was made to this workbook definition. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public global::System.DateTime? TimeModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).TimeModified; } + public global::System.DateTime? TimeModified { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).TimeModified; } /// /// 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)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__workbookResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__workbookResource).Type; } /// Unique user id of the specific user that owns this workbook. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).UserId; } + public string UserId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).UserId; } /// /// Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)Property).Version = value ?? null; } + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)Property).Version = value ?? null; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -256,12 +277,15 @@ public Workbook() /// A workbook definition. public partial interface IWorkbook : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource { /// Workbook category, as defined by the user at creation time. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook category, as defined by the user at creation time.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -270,6 +294,9 @@ public partial interface IWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the workbook.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -278,6 +305,9 @@ public partial interface IWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user-defined name (display name) of the workbook.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -286,14 +316,20 @@ public partial interface IWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Being deprecated, please use the other tags field", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - string[] PropertiesTag { get; set; } + System.Collections.Generic.List PropertiesTag { get; set; } /// The unique revision id for this workbook definition [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The unique revision id for this workbook definition", SerializedName = @"revision", PossibleTypes = new [] { typeof(string) })] @@ -304,6 +340,9 @@ public partial interface IWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Configuration of this particular workbook. Configuration data is a string containing valid JSON", SerializedName = @"serializedData", PossibleTypes = new [] { typeof(string) })] @@ -312,6 +351,9 @@ public partial interface IWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"ResourceId for a source resource.", SerializedName = @"sourceId", PossibleTypes = new [] { typeof(string) })] @@ -320,6 +362,9 @@ public partial interface IWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resourceId to the storage account when bring your own storage is used", SerializedName = @"storageUri", PossibleTypes = new [] { typeof(string) })] @@ -327,57 +372,80 @@ public partial interface IWorkbook : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// Date and time in UTC of the last modification that was made to this workbook definition. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date and time in UTC of the last modification that was made to this workbook definition.", SerializedName = @"timeModified", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -386,6 +454,9 @@ public partial interface IWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Unique user id of the specific user that owns this workbook.", SerializedName = @"userId", PossibleTypes = new [] { typeof(string) })] @@ -396,6 +467,9 @@ public partial interface IWorkbook : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -404,7 +478,7 @@ public partial interface IWorkbook : } /// A workbook definition. internal partial interface IWorkbookInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal { /// Workbook category, as defined by the user at creation time. string Category { get; set; } @@ -413,9 +487,9 @@ internal partial interface IWorkbookInternal : /// The user-defined name (display name) of the workbook. string DisplayName { get; set; } /// Being deprecated, please use the other tags field - string[] PropertiesTag { get; set; } + System.Collections.Generic.List PropertiesTag { get; set; } /// Metadata describing a workbook for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties Property { get; set; } /// The unique revision id for this workbook definition string Revision { get; set; } /// @@ -427,19 +501,21 @@ internal partial interface IWorkbookInternal : /// The resourceId to the storage account when bring your own storage is used string StorageUri { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// Date and time in UTC of the last modification that was made to this workbook definition. /// diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.json.cs index ed7786921899..fc7e1cbbab03 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Workbook 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.Api20220401.IWorkbook. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new Workbook(json) : null; } @@ -86,7 +86,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN } __workbookResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } @@ -106,9 +106,9 @@ internal Workbook(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime { return; } - __workbookResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} + __workbookResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.PowerShell.cs similarity index 66% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.PowerShell.cs index f93f83519127..372626cd88db 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkbookError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookError(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,29 +128,29 @@ internal WorkbookError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookErrorDefinitionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookErrorDefinitionTypeConverter.ConvertFrom); } if (content.Contains("InnerError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).InnerError = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace) content.GetValueForProperty("InnerError",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).InnerError, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookInnerErrorTraceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).InnerError = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace) content.GetValueForProperty("InnerError",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).InnerError, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookInnerErrorTraceTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("InnerErrorTrace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).InnerErrorTrace = (string[]) content.GetValueForProperty("InnerErrorTrace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).InnerErrorTrace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).InnerErrorTrace = (System.Collections.Generic.List) content.GetValueForProperty("InnerErrorTrace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).InnerErrorTrace, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -165,23 +165,23 @@ internal WorkbookError(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookErrorDefinitionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookErrorDefinitionTypeConverter.ConvertFrom); } if (content.Contains("InnerError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).InnerError = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace) content.GetValueForProperty("InnerError",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).InnerError, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookInnerErrorTraceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).InnerError = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace) content.GetValueForProperty("InnerError",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).InnerError, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookInnerErrorTraceTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("InnerErrorTrace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).InnerErrorTrace = (string[]) content.GetValueForProperty("InnerErrorTrace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal)this).InnerErrorTrace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).InnerErrorTrace = (System.Collections.Generic.List) content.GetValueForProperty("InnerErrorTrace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal)this).InnerErrorTrace, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.TypeConverter.cs index 02f712785eeb..2472b6e3dba4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.cs similarity index 63% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.cs index 130acda3e252..ef9eeef16ec1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error response. public partial class WorkbookError : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal { /// @@ -18,40 +18,40 @@ public partial class WorkbookError : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition _error; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition _error; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookErrorDefinition()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookErrorDefinition()); set => this._error = value; } /// detailed error trace [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string[] InnerErrorTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).InnerErrorTrace; } + public System.Collections.Generic.List InnerErrorTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).InnerErrorTrace; } /// Description of the error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).Code = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookErrorDefinition()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookErrorDefinition()); set { {_error = value;} } } /// Internal Acessors for InnerError - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal.InnerError { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).InnerError; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).InnerError = value; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal.InnerError { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).InnerError; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).InnerError = value ?? null /* model class */; } /// Internal Acessors for InnerErrorTrace - string[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal.InnerErrorTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).InnerErrorTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).InnerErrorTrace = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal.InnerErrorTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).InnerErrorTrace; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).InnerErrorTrace = value ?? null /* arrayOf */; } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)Error).Message = value ?? null; } /// Creates an new instance. public WorkbookError() @@ -69,6 +69,9 @@ public partial interface IWorkbookError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service specific error code which serves as the substatus for the HTTP error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -77,14 +80,20 @@ public partial interface IWorkbookError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"detailed error trace", SerializedName = @"trace", PossibleTypes = new [] { typeof(string) })] - string[] InnerErrorTrace { get; } + System.Collections.Generic.List InnerErrorTrace { get; } /// Description of the error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Description of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -100,11 +109,11 @@ internal partial interface IWorkbookErrorInternal /// string Code { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition Error { get; set; } /// Internal error details. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace InnerError { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace InnerError { get; set; } /// detailed error trace - string[] InnerErrorTrace { get; set; } + System.Collections.Generic.List InnerErrorTrace { get; set; } /// Description of the error. string Message { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.json.cs index ae67bdb334b8..b63f9942bad2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookError 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.Api20220401.IWorkbookError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookError(json) : null; } @@ -101,7 +101,7 @@ internal WorkbookError(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Ru { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookErrorDefinition.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookErrorDefinition.FromJson(__jsonError) : _error;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.PowerShell.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.PowerShell.cs index 4ff3408cbe4c..35222f3fdce3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookErrorDefinition partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookErrorDefinition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookErrorDefinition(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,25 +128,25 @@ internal WorkbookErrorDefinition(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("InnerError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).InnerError = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace) content.GetValueForProperty("InnerError",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).InnerError, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookInnerErrorTraceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).InnerError = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace) content.GetValueForProperty("InnerError",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).InnerError, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookInnerErrorTraceTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("InnerErrorTrace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).InnerErrorTrace = (string[]) content.GetValueForProperty("InnerErrorTrace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).InnerErrorTrace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).InnerErrorTrace = (System.Collections.Generic.List) content.GetValueForProperty("InnerErrorTrace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).InnerErrorTrace, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -163,19 +161,19 @@ internal WorkbookErrorDefinition(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("InnerError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).InnerError = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace) content.GetValueForProperty("InnerError",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).InnerError, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookInnerErrorTraceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).InnerError = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace) content.GetValueForProperty("InnerError",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).InnerError, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookInnerErrorTraceTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("InnerErrorTrace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).InnerErrorTrace = (string[]) content.GetValueForProperty("InnerErrorTrace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal)this).InnerErrorTrace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).InnerErrorTrace = (System.Collections.Generic.List) content.GetValueForProperty("InnerErrorTrace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal)this).InnerErrorTrace, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.TypeConverter.cs index d1cc1c39c018..a52c1f28e814 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.cs similarity index 72% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.cs index 16eb4afc3da2..51256677aac0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error definition. public partial class WorkbookErrorDefinition : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal { /// Backing field for property. @@ -24,17 +24,17 @@ public partial class WorkbookErrorDefinition : public string Code { get => this._code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace _innerError; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace _innerError; /// Internal error details. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace InnerError { get => (this._innerError = this._innerError ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookInnerErrorTrace()); } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace InnerError { get => (this._innerError = this._innerError ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookInnerErrorTrace()); } /// detailed error trace [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string[] InnerErrorTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTraceInternal)InnerError).Trace; } + public System.Collections.Generic.List InnerErrorTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal)InnerError).Trace; } /// Backing field for property. private string _message; @@ -45,16 +45,16 @@ public partial class WorkbookErrorDefinition : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for InnerError - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal.InnerError { get => (this._innerError = this._innerError ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookInnerErrorTrace()); set { {_innerError = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal.InnerError { get => (this._innerError = this._innerError ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookInnerErrorTrace()); set { {_innerError = value;} } } /// Internal Acessors for InnerErrorTrace - string[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal.InnerErrorTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTraceInternal)InnerError).Trace; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTraceInternal)InnerError).Trace = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal.InnerErrorTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal)InnerError).Trace; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal)InnerError).Trace = value ?? null /* arrayOf */; } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal.Message { get => this._message; set { {_message = value;} } } /// Creates an new instance. public WorkbookErrorDefinition() @@ -72,6 +72,9 @@ public partial interface IWorkbookErrorDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Service specific error code which serves as the substatus for the HTTP error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -80,14 +83,20 @@ public partial interface IWorkbookErrorDefinition : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"detailed error trace", SerializedName = @"trace", PossibleTypes = new [] { typeof(string) })] - string[] InnerErrorTrace { get; } + System.Collections.Generic.List InnerErrorTrace { get; } /// Description of the error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Description of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -103,9 +112,9 @@ internal partial interface IWorkbookErrorDefinitionInternal /// string Code { get; set; } /// Internal error details. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace InnerError { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace InnerError { get; set; } /// detailed error trace - string[] InnerErrorTrace { get; set; } + System.Collections.Generic.List InnerErrorTrace { get; set; } /// Description of the error. string Message { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.json.cs index 0b60e966e534..09839d82c171 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookErrorDefinition 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.Api20220401.IWorkbookErrorDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookErrorDefinition(json) : null; } @@ -84,15 +84,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._innerError ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._innerError.ToJson(null,serializationMode) : null, "innerError" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); } @@ -112,9 +112,9 @@ internal WorkbookErrorDefinition(Microsoft.Azure.PowerShell.Cmdlets.ApplicationI { return; } - {_innerError = If( json?.PropertyT("innerError"), out var __jsonInnerError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookInnerErrorTrace.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;} + {_innerError = If( json?.PropertyT("innerError"), out var __jsonInnerError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookInnerErrorTrace.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); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.PowerShell.cs similarity index 82% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.PowerShell.cs index 27b5ab58ddf1..f8398935b256 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookInnerErrorTrace partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookInnerErrorTrace(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookInnerErrorTrace(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,13 +128,13 @@ internal WorkbookInnerErrorTrace(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Trace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTraceInternal)this).Trace = (string[]) content.GetValueForProperty("Trace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTraceInternal)this).Trace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal)this).Trace = (System.Collections.Generic.List) content.GetValueForProperty("Trace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal)this).Trace, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -151,7 +149,7 @@ internal WorkbookInnerErrorTrace(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Trace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTraceInternal)this).Trace = (string[]) content.GetValueForProperty("Trace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTraceInternal)this).Trace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal)this).Trace = (System.Collections.Generic.List) content.GetValueForProperty("Trace",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal)this).Trace, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.TypeConverter.cs index 83824bcfb86b..d44b45755fcc 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.cs similarity index 75% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.cs index 6b91967633ff..49b45df56502 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.cs @@ -3,26 +3,26 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error details public partial class WorkbookInnerErrorTrace : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTraceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal { /// Internal Acessors for Trace - string[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTraceInternal.Trace { get => this._trace; set { {_trace = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal.Trace { get => this._trace; set { {_trace = value;} } } /// Backing field for property. - private string[] _trace; + private System.Collections.Generic.List _trace; /// detailed error trace [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string[] Trace { get => this._trace; } + public System.Collections.Generic.List Trace { get => this._trace; } /// Creates an new instance. public WorkbookInnerErrorTrace() @@ -38,10 +38,13 @@ public partial interface IWorkbookInnerErrorTrace : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"detailed error trace", SerializedName = @"trace", PossibleTypes = new [] { typeof(string) })] - string[] Trace { get; } + System.Collections.Generic.List Trace { get; } } /// Error details @@ -49,7 +52,7 @@ internal partial interface IWorkbookInnerErrorTraceInternal { /// detailed error trace - string[] Trace { get; set; } + System.Collections.Generic.List Trace { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.json.cs similarity index 92% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.json.cs index 8d67206182a2..f98d752147a0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookInnerErrorTrace.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookInnerErrorTrace.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookInnerErrorTrace 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.Api20220401.IWorkbookInnerErrorTrace. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookInnerErrorTrace(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { if (null != this._trace) { @@ -112,7 +112,7 @@ internal WorkbookInnerErrorTrace(Microsoft.Azure.PowerShell.Cmdlets.ApplicationI { return; } - {_trace = If( json?.PropertyT("trace"), out var __jsonTrace) ? If( __jsonTrace 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 : Trace;} + {_trace = If( json?.PropertyT("trace"), out var __jsonTrace) ? If( __jsonTrace as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _trace;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.PowerShell.cs similarity index 59% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.PowerShell.cs index 53b426ab3cdd..4228ffb3b16f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookProperties(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,53 +128,53 @@ internal WorkbookProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("SerializedData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).SerializedData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).SerializedData, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Version, global::System.Convert.ToString); } if (content.Contains("TimeModified")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).TimeModified = (global::System.DateTime?) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).TimeModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).TimeModified = (global::System.DateTime?) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).TimeModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Tag = (System.Collections.Generic.List) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("UserId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).UserId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).UserId, global::System.Convert.ToString); } if (content.Contains("SourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).SourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).SourceId, global::System.Convert.ToString); } if (content.Contains("StorageUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).StorageUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).StorageUri, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Revision, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Revision, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -191,47 +189,47 @@ internal WorkbookProperties(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("SerializedData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).SerializedData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).SerializedData, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Version, global::System.Convert.ToString); } if (content.Contains("TimeModified")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).TimeModified = (global::System.DateTime?) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).TimeModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).TimeModified = (global::System.DateTime?) content.GetValueForProperty("TimeModified",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).TimeModified, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Tag = (System.Collections.Generic.List) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("UserId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).UserId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).UserId, global::System.Convert.ToString); } if (content.Contains("SourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).SourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).SourceId = (string) content.GetValueForProperty("SourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).SourceId, global::System.Convert.ToString); } if (content.Contains("StorageUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).StorageUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).StorageUri, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal)this).Revision, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Revision, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.TypeConverter.cs index aa469013f4ef..4c417ca34c77 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.cs index faf4e1a21d6f..a6272d210146 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Properties that contain a workbook. public partial class WorkbookProperties : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal { /// Backing field for property. @@ -38,13 +38,13 @@ public partial class WorkbookProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for Revision - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal.Revision { get => this._revision; set { {_revision = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal.Revision { get => this._revision; set { {_revision = value;} } } /// Internal Acessors for TimeModified - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal.TimeModified { get => this._timeModified; set { {_timeModified = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal.TimeModified { get => this._timeModified; set { {_timeModified = value;} } } /// Internal Acessors for UserId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesInternal.UserId { get => this._userId; set { {_userId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal.UserId { get => this._userId; set { {_userId = value;} } } /// Backing field for property. private string _revision; @@ -81,12 +81,12 @@ public partial class WorkbookProperties : public string StorageUri { get => this._storageUri; set => this._storageUri = value; } /// Backing field for property. - private string[] _tag; + private System.Collections.Generic.List _tag; /// Being deprecated, please use the other tags field [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string[] Tag { get => this._tag; set => this._tag = value; } + public System.Collections.Generic.List Tag { get => this._tag; set => this._tag = value; } /// Backing field for property. private global::System.DateTime? _timeModified; @@ -130,6 +130,9 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook category, as defined by the user at creation time.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -138,6 +141,9 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the workbook.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -146,6 +152,9 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user-defined name (display name) of the workbook.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -154,6 +163,9 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The unique revision id for this workbook definition", SerializedName = @"revision", PossibleTypes = new [] { typeof(string) })] @@ -164,6 +176,9 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Configuration of this particular workbook. Configuration data is a string containing valid JSON", SerializedName = @"serializedData", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +187,9 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"ResourceId for a source resource.", SerializedName = @"sourceId", PossibleTypes = new [] { typeof(string) })] @@ -180,6 +198,9 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resourceId to the storage account when bring your own storage is used", SerializedName = @"storageUri", PossibleTypes = new [] { typeof(string) })] @@ -188,16 +209,22 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Being deprecated, please use the other tags field", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - string[] Tag { get; set; } + System.Collections.Generic.List Tag { get; set; } /// /// Date and time in UTC of the last modification that was made to this workbook definition. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Date and time in UTC of the last modification that was made to this workbook definition.", SerializedName = @"timeModified", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -206,6 +233,9 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Unique user id of the specific user that owns this workbook.", SerializedName = @"userId", PossibleTypes = new [] { typeof(string) })] @@ -216,6 +246,9 @@ public partial interface IWorkbookProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -243,7 +276,7 @@ internal partial interface IWorkbookPropertiesInternal /// The resourceId to the storage account when bring your own storage is used string StorageUri { get; set; } /// Being deprecated, please use the other tags field - string[] Tag { get; set; } + System.Collections.Generic.List Tag { get; set; } /// /// Date and time in UTC of the last modification that was made to this workbook definition. /// diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.json.cs index 70d4f7023f0f..e248c6b5402c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookProperties 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.Api20220401.IWorkbookProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookProperties(json) : null; } @@ -87,7 +87,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); AddIf( null != (((object)this._serializedData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._serializedData.ToString()) : null, "serializedData" ,container.Add ); AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._timeModified ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._timeModified?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timeModified" ,container.Add ); } @@ -101,14 +101,14 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN } container.Add("tags",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); } AddIf( null != (((object)this._sourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._sourceId.ToString()) : null, "sourceId" ,container.Add ); AddIf( null != (((object)this._storageUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._storageUri.ToString()) : null, "storageUri" ,container.Add ); 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._revision)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._revision.ToString()) : null, "revision" ,container.Add ); } @@ -128,17 +128,17 @@ internal WorkbookProperties(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsigh { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_serializedData = If( json?.PropertyT("serializedData"), out var __jsonSerializedData) ? (string)__jsonSerializedData : (string)SerializedData;} - {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} - {_timeModified = If( json?.PropertyT("timeModified"), out var __jsonTimeModified) ? global::System.DateTime.TryParse((string)__jsonTimeModified, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeModifiedValue) ? __jsonTimeModifiedValue : TimeModified : TimeModified;} - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags 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 : Tag;} - {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} - {_sourceId = If( json?.PropertyT("sourceId"), out var __jsonSourceId) ? (string)__jsonSourceId : (string)SourceId;} - {_storageUri = If( json?.PropertyT("storageUri"), out var __jsonStorageUri) ? (string)__jsonStorageUri : (string)StorageUri;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (string)__jsonRevision : (string)Revision;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_serializedData = If( json?.PropertyT("serializedData"), out var __jsonSerializedData) ? (string)__jsonSerializedData : (string)_serializedData;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} + {_timeModified = If( json?.PropertyT("timeModified"), out var __jsonTimeModified) ? global::System.DateTime.TryParse((string)__jsonTimeModified, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeModifiedValue) ? __jsonTimeModifiedValue : _timeModified : _timeModified;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _tag;} + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)_userId;} + {_sourceId = If( json?.PropertyT("sourceId"), out var __jsonSourceId) ? (string)__jsonSourceId : (string)_sourceId;} + {_storageUri = If( json?.PropertyT("storageUri"), out var __jsonStorageUri) ? (string)__jsonStorageUri : (string)_storageUri;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (string)__jsonRevision : (string)_revision;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.PowerShell.cs similarity index 66% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.PowerShell.cs index c6ff48d06d76..d5956b1df615 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WorkbookPropertiesUpdateParameters partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20220401.IWorkbookPropertiesUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookPropertiesUpdateParameters(content); } /// - /// Deserializes a into an instance of 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.Api20220401.IWorkbookPropertiesUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookPropertiesUpdateParameters(content); } @@ -97,7 +97,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -117,7 +117,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -132,33 +132,33 @@ internal WorkbookPropertiesUpdateParameters(global::System.Collections.IDictiona // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("SerializedData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).SerializedData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).SerializedData, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Tag = (System.Collections.Generic.List) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Tag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Revision, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Revision, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -173,27 +173,27 @@ internal WorkbookPropertiesUpdateParameters(global::System.Management.Automation // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("SerializedData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).SerializedData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).SerializedData, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Tag = (System.Collections.Generic.List) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Tag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)this).Revision, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Revision, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.TypeConverter.cs index d768da595b72..894b5498664c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.cs index 3eb6c6c40fee..ac7f6c24c1d7 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Properties that contain a workbook for PATCH operation. public partial class WorkbookPropertiesUpdateParameters : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal { /// Backing field for property. @@ -56,12 +56,12 @@ public partial class WorkbookPropertiesUpdateParameters : public string SerializedData { get => this._serializedData; set => this._serializedData = value; } /// Backing field for property. - private string[] _tag; + private System.Collections.Generic.List _tag; /// A list of 0 or more tags that are associated with this workbook definition [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string[] Tag { get => this._tag; set => this._tag = value; } + public System.Collections.Generic.List Tag { get => this._tag; set => this._tag = value; } /// Creates an new instance. public WorkbookPropertiesUpdateParameters() @@ -77,6 +77,9 @@ public partial interface IWorkbookPropertiesUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook category, as defined by the user at creation time.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +88,9 @@ public partial interface IWorkbookPropertiesUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the workbook.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +99,9 @@ public partial interface IWorkbookPropertiesUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user-defined name (display name) of the workbook.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -101,6 +110,9 @@ public partial interface IWorkbookPropertiesUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The unique revision id for this workbook definition", SerializedName = @"revision", PossibleTypes = new [] { typeof(string) })] @@ -111,6 +123,9 @@ public partial interface IWorkbookPropertiesUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Configuration of this particular workbook. Configuration data is a string containing valid JSON", SerializedName = @"serializedData", PossibleTypes = new [] { typeof(string) })] @@ -119,10 +134,13 @@ public partial interface IWorkbookPropertiesUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of 0 or more tags that are associated with this workbook definition", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - string[] Tag { get; set; } + System.Collections.Generic.List Tag { get; set; } } /// Properties that contain a workbook for PATCH operation. @@ -142,7 +160,7 @@ internal partial interface IWorkbookPropertiesUpdateParametersInternal /// string SerializedData { get; set; } /// A list of 0 or more tags that are associated with this workbook definition - string[] Tag { get; set; } + System.Collections.Generic.List Tag { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.json.cs index 5ef1986e1ec0..5a5a0d2bab0d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookPropertiesUpdateParameters 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.Api20220401.IWorkbookPropertiesUpdateParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookPropertiesUpdateParameters(json) : null; } @@ -115,12 +115,12 @@ internal WorkbookPropertiesUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.A { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_serializedData = If( json?.PropertyT("serializedData"), out var __jsonSerializedData) ? (string)__jsonSerializedData : (string)SerializedData;} - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags 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 : Tag;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (string)__jsonRevision : (string)Revision;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_serializedData = If( json?.PropertyT("serializedData"), out var __jsonSerializedData) ? (string)__jsonSerializedData : (string)_serializedData;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _tag;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (string)__jsonRevision : (string)_revision;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.PowerShell.cs similarity index 55% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.PowerShell.cs index effec862d9a0..abeb2b243fcf 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookResource(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,57 +128,57 @@ internal WorkbookResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentityTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResourceIdentityTypeConverter.ConvertFrom); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Etag, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -195,51 +193,51 @@ internal WorkbookResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Identity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentityTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResourceIdentityTypeConverter.ConvertFrom); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Etag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).Etag, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).Etag, global::System.Convert.ToString); } 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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("IdentityPrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); } if (content.Contains("IdentityTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityTenantId, global::System.Convert.ToString); } if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("IdentityUserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.TypeConverter.cs index 8fe24db92f3f..c5ade516bac8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.cs index 2d3161051610..233cefa49518 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.cs @@ -3,21 +3,21 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// An azure resource object public partial class WorkbookResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResource(); /// Backing field for property. private string _etag; @@ -32,36 +32,36 @@ public partial class WorkbookResource : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__trackedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__trackedResource).Id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity _identity; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity _identity; /// Identity used for BYOS [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentity()); set => this._identity = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResourceIdentity()); set => this._identity = value; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).PrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).PrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).TenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).TenantId; } /// /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).Type = value ?? null; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -70,55 +70,55 @@ public partial class WorkbookResource : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind? _kind; + private string _kind; /// The kind of workbook. Only valid value is shared. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 4)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind? Kind { get => this._kind; set => this._kind = value; } + public string Kind { get => this._kind; set => this._kind = value; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 3)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)__trackedResource).Location = value ; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)__trackedResource).Location = 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)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__trackedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__trackedResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__trackedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__trackedResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__trackedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__trackedResource).Type = value ?? null; } /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentity()); set { {_identity = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResourceIdentity()); set { {_identity = value;} } } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).PrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).PrincipalId = value ?? null; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)Identity).TenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)Identity).TenantId = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__trackedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__trackedResource).Name; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// 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)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__trackedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__trackedResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -141,12 +141,15 @@ public WorkbookResource() /// An azure resource object public partial interface IWorkbookResource : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource { /// Resource etag [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource etag", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -157,6 +160,9 @@ public partial interface IWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -167,6 +173,9 @@ public partial interface IWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -177,10 +186,14 @@ public partial interface IWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType? IdentityType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] + string IdentityType { get; set; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. @@ -189,28 +202,35 @@ public partial interface IWorkbookResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// The kind of workbook. Only valid value is shared. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The kind of workbook. Only valid value is shared.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind? Kind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("shared")] + string Kind { get; set; } } /// An azure resource object internal partial interface IWorkbookResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceInternal { /// Resource etag string Etag { get; set; } /// Identity used for BYOS - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity Identity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity Identity { get; set; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// @@ -222,15 +242,17 @@ internal partial interface IWorkbookResourceInternal : /// /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType? IdentityType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned")] + string IdentityType { get; set; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. /// The dictionary values can be empty objects ({}) in requests. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } /// The kind of workbook. Only valid value is shared. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind? Kind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("shared")] + string Kind { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.json.cs index 2e144f6e1a66..7c7c1141f9aa 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookResource 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.Api20220401.IWorkbookResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookResource(json) : null; } @@ -104,10 +104,10 @@ internal WorkbookResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.TrackedResource(json); - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentity.FromJson(__jsonIdentity) : Identity;} - {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResource(json); + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookResourceIdentity.FromJson(__jsonIdentity) : _identity;} + {_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); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.PowerShell.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.PowerShell.cs index da02608113eb..84b9b64c8df6 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookResourceIdentity partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookResourceIdentity(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookResourceIdentity(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,25 +128,25 @@ internal WorkbookResourceIdentity(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -163,19 +161,19 @@ internal WorkbookResourceIdentity(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentitiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.TypeConverter.cs index feef27efc5fe..78397da5e4b0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceIdentity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceIdentity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.cs similarity index 67% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.cs index 40a3913e8151..c21b2fed54f8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.cs @@ -3,48 +3,48 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Identity used for BYOS public partial class WorkbookResourceIdentity : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceIdentity, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceIdentityInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentityInternal, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity __managedServiceIdentity = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentity(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity __managedServiceIdentity = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ManagedServiceIdentity(); /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal.PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).PrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal.PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).PrincipalId = value ?? null; } /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal.TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).TenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal.TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).TenantId = value ?? null; } /// /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).PrincipalId; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).PrincipalId; } /// /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).TenantId; } + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).TenantId; } /// /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).Type = value ; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).Type = value ; } /// /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM @@ -53,7 +53,7 @@ public partial class WorkbookResourceIdentity : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities UserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal)__managedServiceIdentity).UserAssignedIdentity = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities UserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal)__managedServiceIdentity).UserAssignedIdentity = value ?? null /* model class */; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -76,13 +76,13 @@ public WorkbookResourceIdentity() /// Identity used for BYOS public partial interface IWorkbookResourceIdentity : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity { } /// Identity used for BYOS internal partial interface IWorkbookResourceIdentityInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal { } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.json.cs index 6f10b2fbd7c5..d73d964e0ff1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookResourceIdentity 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.Api20220401.IWorkbookResourceIdentity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceIdentity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookResourceIdentity(json) : null; } @@ -101,7 +101,7 @@ internal WorkbookResourceIdentity(Microsoft.Azure.PowerShell.Cmdlets.Application { return; } - __managedServiceIdentity = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.ManagedServiceIdentity(json); + __managedServiceIdentity = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ManagedServiceIdentity(json); AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.PowerShell.cs similarity index 53% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.PowerShell.cs index 26f6a7725e7e..f491c407b417 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookTemplate partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplate(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplate(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,53 +128,53 @@ internal WorkbookTemplate(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Priority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Author")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Author, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Author, global::System.Convert.ToString); } if (content.Contains("TemplateData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); } if (content.Contains("Gallery")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Gallery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Gallery, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Gallery = (System.Collections.Generic.List) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Gallery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); } if (content.Contains("Localized")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -191,47 +189,47 @@ internal WorkbookTemplate(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Priority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Author")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Author, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Author, global::System.Convert.ToString); } if (content.Contains("TemplateData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); } if (content.Contains("Gallery")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Gallery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Gallery, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Gallery = (System.Collections.Generic.List) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Gallery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); } if (content.Contains("Localized")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.TypeConverter.cs index 635d516ca95e..c5001db45497 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.cs similarity index 66% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.cs index a865d3611a98..dc90a7c6dc72 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.cs @@ -3,80 +3,80 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// An Application Insights workbook template definition. public partial class WorkbookTemplate : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource __workbookTemplateResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource __workbookTemplateResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResource(); /// Information about the author of the workbook template. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Author { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Author; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Author = value ?? null; } + public string Author { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Author; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Author = value ?? null; } /// Workbook galleries supported by the template. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Gallery; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Gallery = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Gallery { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Gallery; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Gallery = value ?? null /* arrayOf */; } /// Azure resource Id [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Id; } /// /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Localized; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Localized = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Localized; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Localized = value ?? null /* model class */; } /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 3)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Location = value ; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Location = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateProperties()); set { {_property = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Type = value ?? null; } /// Azure resource name. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 1)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Name; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public int? Priority { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Priority; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Priority = value ?? default(int); } + public int? Priority { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Priority; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Priority = value ?? default(int); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties _property; /// Metadata describing a workbook template for an Azure resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] @@ -86,17 +86,17 @@ public partial class WorkbookTemplate : /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Tag = value ?? null /* model class */; } /// Valid JSON object containing workbook template payload. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).TemplateData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).TemplateData = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).TemplateData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).TemplateData = value ?? null /* model class */; } /// Azure resource type [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -119,12 +119,15 @@ public WorkbookTemplate() /// An Application Insights workbook template definition. public partial interface IWorkbookTemplate : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource { /// Information about the author of the workbook template. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Information about the author of the workbook template.", SerializedName = @"author", PossibleTypes = new [] { typeof(string) })] @@ -133,26 +136,35 @@ public partial interface IWorkbookTemplate : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook galleries supported by the template.", SerializedName = @"galleries", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery) })] + System.Collections.Generic.List Gallery { get; set; } /// /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.", SerializedName = @"localized", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get; set; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.", SerializedName = @"priority", PossibleTypes = new [] { typeof(int) })] @@ -161,32 +173,35 @@ public partial interface IWorkbookTemplate : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Valid JSON object containing workbook template payload.", SerializedName = @"templateData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } } /// An Application Insights workbook template definition. internal partial interface IWorkbookTemplateInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal { /// Information about the author of the workbook template. string Author { get; set; } /// Workbook galleries supported by the template. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get; set; } + System.Collections.Generic.List Gallery { get; set; } /// /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get; set; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. /// int? Priority { get; set; } /// Metadata describing a workbook template for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties Property { get; set; } /// Valid JSON object containing workbook template payload. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.json.cs index 94494b83acfd..8a61690f5105 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplate 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.Api20201120.IWorkbookTemplate. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplate(json) : null; } @@ -102,8 +102,8 @@ internal WorkbookTemplate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights { return; } - __workbookTemplateResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateProperties.FromJson(__jsonProperties) : Property;} + __workbookTemplateResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.PowerShell.cs similarity index 67% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.PowerShell.cs index fc533a6365f9..cc21bb7473cd 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookTemplateError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateError(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,25 +128,25 @@ internal WorkbookTemplateError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorFieldContractTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorFieldContractTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -163,19 +161,19 @@ internal WorkbookTemplateError(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorFieldContractTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorFieldContractTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.TypeConverter.cs index 736f971d9492..151a6085ba6f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.cs similarity index 69% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.cs index 1f7de61bb004..61783900ad9a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error message that will indicate why the operation failed. public partial class WorkbookTemplateError : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal { /// @@ -18,28 +18,28 @@ public partial class WorkbookTemplateError : /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)Error).Code = value ?? null; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)Error).Code = value ?? null; } /// The list of invalid fields send in request, in case of validation error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)Error).Detail = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody _error; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody _error; /// Error message object that will indicate why the operation failed. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorBody()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorBody()); set => this._error = value; } /// Human-readable representation of the error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)Error).Message = value ?? null; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)Error).Message = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorBody()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorBody()); set { {_error = value;} } } /// Creates an new instance. public WorkbookTemplateError() @@ -57,6 +57,9 @@ public partial interface IWorkbookTemplateError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -65,14 +68,20 @@ public partial interface IWorkbookTemplateError : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of invalid fields send in request, in case of validation error.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[] Detail { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract) })] + System.Collections.Generic.List Detail { get; set; } /// Human-readable representation of the error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Human-readable representation of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -88,9 +97,9 @@ internal partial interface IWorkbookTemplateErrorInternal /// string Code { get; set; } /// The list of invalid fields send in request, in case of validation error. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// Error message object that will indicate why the operation failed. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody Error { get; set; } /// Human-readable representation of the error. string Message { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.json.cs index 37be11683a90..70b4072235f5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateError 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.Api20201120.IWorkbookTemplateError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateError(json) : null; } @@ -101,7 +101,7 @@ internal WorkbookTemplateError(Microsoft.Azure.PowerShell.Cmdlets.ApplicationIns { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorBody.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorBody.FromJson(__jsonError) : _error;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.PowerShell.cs similarity index 71% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.PowerShell.cs index c0c5699ec767..d7e434bb9e46 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookTemplateErrorBody partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateErrorBody(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateErrorBody(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,21 +128,21 @@ internal WorkbookTemplateErrorBody(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorFieldContractTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorFieldContractTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -159,15 +157,15 @@ internal WorkbookTemplateErrorBody(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorFieldContractTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorFieldContractTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.TypeConverter.cs index ad6f00ff26ae..9432efa73423 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.cs similarity index 81% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.cs index c1554149e5b0..d1805dd313b1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error message body that will indicate why the operation failed. public partial class WorkbookTemplateErrorBody : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBodyInternal { /// Backing field for property. @@ -24,12 +24,12 @@ public partial class WorkbookTemplateErrorBody : public string Code { get => this._code; set => this._code = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[] _detail; + private System.Collections.Generic.List _detail; /// The list of invalid fields send in request, in case of validation error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[] Detail { get => this._detail; set => this._detail = value; } + public System.Collections.Generic.List Detail { get => this._detail; set => this._detail = value; } /// Backing field for property. private string _message; @@ -55,6 +55,9 @@ public partial interface IWorkbookTemplateErrorBody : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -63,14 +66,20 @@ public partial interface IWorkbookTemplateErrorBody : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of invalid fields send in request, in case of validation error.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[] Detail { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract) })] + System.Collections.Generic.List Detail { get; set; } /// Human-readable representation of the error. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Human-readable representation of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -86,7 +95,7 @@ internal partial interface IWorkbookTemplateErrorBodyInternal /// string Code { get; set; } /// The list of invalid fields send in request, in case of validation error. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// Human-readable representation of the error. string Message { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.json.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.json.cs index eaf69f45e7df..502e9d8c98bf 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateErrorBody 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.Api20201120.IWorkbookTemplateErrorBody. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateErrorBody(json) : null; } @@ -111,9 +111,9 @@ internal WorkbookTemplateErrorBody(Microsoft.Azure.PowerShell.Cmdlets.Applicatio { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.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.Api20201120.IWorkbookTemplateErrorFieldContract) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateErrorFieldContract.FromJson(__u) )) ))() : null : Detail;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateErrorFieldContract.FromJson(__u) )) ))() : null : _detail;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.PowerShell.cs similarity index 75% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.PowerShell.cs index 73c9c8ef3259..8973294f39e4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WorkbookTemplateErrorFieldContract partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateErrorFieldContract DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateErrorFieldContract(content); } /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateErrorFieldContract DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateErrorFieldContract(content); } @@ -97,7 +97,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -117,7 +117,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -132,21 +132,21 @@ internal WorkbookTemplateErrorFieldContract(global::System.Collections.IDictiona // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Target, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -161,15 +161,15 @@ internal WorkbookTemplateErrorFieldContract(global::System.Management.Automation // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal)this).Target, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.TypeConverter.cs index 7d6ba3410896..abdc45205c8c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.cs index 0903c963e1c4..827223b8e9e0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Error Field contract. public partial class WorkbookTemplateErrorFieldContract : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContractInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContractInternal { /// Backing field for property. @@ -51,6 +51,9 @@ public partial interface IWorkbookTemplateErrorFieldContract : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Property level error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -59,6 +62,9 @@ public partial interface IWorkbookTemplateErrorFieldContract : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Human-readable representation of property-level error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -67,6 +73,9 @@ public partial interface IWorkbookTemplateErrorFieldContract : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Property name.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.json.cs index f2d73bdbb9dd..6fb5476f66ca 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorFieldContract.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorFieldContract.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateErrorFieldContract 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.Api20201120.IWorkbookTemplateErrorFieldContract. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorFieldContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateErrorFieldContract(json) : null; } @@ -104,9 +104,9 @@ internal WorkbookTemplateErrorFieldContract(Microsoft.Azure.PowerShell.Cmdlets.A { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.PowerShell.cs similarity index 70% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.PowerShell.cs index 476409160c4b..bef150699dbc 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookTemplateGallery partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateGallery(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateGallery(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,29 +128,29 @@ internal WorkbookTemplateGallery(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Order")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Order = (int?) content.GetValueForProperty("Order",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Order, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Order = (int?) content.GetValueForProperty("Order",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Order, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ResourceType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).ResourceType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).ResourceType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -167,23 +165,23 @@ internal WorkbookTemplateGallery(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Order")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Order = (int?) content.GetValueForProperty("Order",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Order, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Order = (int?) content.GetValueForProperty("Order",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).Order, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ResourceType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).ResourceType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).ResourceType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.TypeConverter.cs index d7b216868404..a212bc0b1add 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.cs index 423c7def91e0..f75231d0277c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Gallery information for a workbook template. public partial class WorkbookTemplateGallery : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal { /// Backing field for property. @@ -67,6 +67,9 @@ public partial interface IWorkbookTemplateGallery : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Category for the gallery.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IWorkbookTemplateGallery : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the workbook template in the gallery.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IWorkbookTemplateGallery : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Order of the template within the gallery.", SerializedName = @"order", PossibleTypes = new [] { typeof(int) })] @@ -91,6 +100,9 @@ public partial interface IWorkbookTemplateGallery : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Azure resource type supported by the gallery.", SerializedName = @"resourceType", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +111,9 @@ public partial interface IWorkbookTemplateGallery : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of workbook supported by the workbook template.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.json.cs similarity index 94% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.json.cs index 798892b00cdd..59e3e9554186 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateGallery 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.Api20201120.IWorkbookTemplateGallery. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateGallery(json) : null; } @@ -105,11 +105,11 @@ internal WorkbookTemplateGallery(Microsoft.Azure.PowerShell.Cmdlets.ApplicationI { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_order = If( json?.PropertyT("order"), out var __jsonOrder) ? (int?)__jsonOrder : Order;} - {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_order = If( json?.PropertyT("order"), out var __jsonOrder) ? (int?)__jsonOrder : _order;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)_resourceType;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.PowerShell.cs similarity index 72% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.PowerShell.cs index 7a3bc08cda76..8fd0d3d50ebe 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WorkbookTemplateLocalizedGallery partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateLocalizedGallery DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGallery DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateLocalizedGallery(content); } /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateLocalizedGallery DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGallery DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateLocalizedGallery(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGallery FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGallery FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,17 +130,17 @@ internal WorkbookTemplateLocalizedGallery(global::System.Collections.IDictionary // actually deserialize if (content.Contains("TemplateData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGalleryInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGalleryInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGalleryInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGalleryInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); } if (content.Contains("Gallery")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGalleryInternal)this).Gallery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGalleryInternal)this).Gallery, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGalleryInternal)this).Gallery = (System.Collections.Generic.List) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGalleryInternal)this).Gallery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -155,11 +155,11 @@ internal WorkbookTemplateLocalizedGallery(global::System.Management.Automation.P // actually deserialize if (content.Contains("TemplateData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGalleryInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGalleryInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGalleryInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGalleryInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); } if (content.Contains("Gallery")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGalleryInternal)this).Gallery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGalleryInternal)this).Gallery, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGalleryInternal)this).Gallery = (System.Collections.Generic.List) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGalleryInternal)this).Gallery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.TypeConverter.cs index 98bf8bc52cbd..9dcf7a41a9e9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGallery ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGallery ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGallery).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGallery).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.cs similarity index 79% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.cs index 4321d67a3b5e..cd3f34333f7b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.cs @@ -3,23 +3,23 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Localized template data and gallery information. public partial class WorkbookTemplateLocalizedGallery : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGallery, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGalleryInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGallery, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGalleryInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] _gallery; + private System.Collections.Generic.List _gallery; /// Workbook galleries supported by the template. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get => this._gallery; set => this._gallery = value; } + public System.Collections.Generic.List Gallery { get => this._gallery; set => this._gallery = value; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny _templateData; @@ -43,14 +43,20 @@ public partial interface IWorkbookTemplateLocalizedGallery : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook galleries supported by the template.", SerializedName = @"galleries", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery) })] + System.Collections.Generic.List Gallery { get; set; } /// Valid JSON object containing workbook template payload. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Valid JSON object containing workbook template payload.", SerializedName = @"templateData", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) })] @@ -62,7 +68,7 @@ internal partial interface IWorkbookTemplateLocalizedGalleryInternal { /// Workbook galleries supported by the template. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get; set; } + System.Collections.Generic.List Gallery { get; set; } /// Valid JSON object containing workbook template payload. Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny TemplateData { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.json.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.json.cs index 09cd3213e532..210f3ff22df9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateLocalizedGallery 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.Api20201120.IWorkbookTemplateLocalizedGallery. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGallery. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGallery. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGallery. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateLocalizedGallery FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateLocalizedGallery FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateLocalizedGallery(json) : null; } @@ -110,8 +110,8 @@ internal WorkbookTemplateLocalizedGallery(Microsoft.Azure.PowerShell.Cmdlets.App { return; } - {_templateData = If( json?.PropertyT("templateData"), out var __jsonTemplateData) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Any.FromJson(__jsonTemplateData) : TemplateData;} - {_gallery = If( json?.PropertyT("galleries"), out var __jsonGalleries) ? If( __jsonGalleries 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.Api20201120.IWorkbookTemplateGallery) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGallery.FromJson(__u) )) ))() : null : Gallery;} + {_templateData = If( json?.PropertyT("templateData"), out var __jsonTemplateData) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Any.FromJson(__jsonTemplateData) : _templateData;} + {_gallery = If( json?.PropertyT("galleries"), out var __jsonGalleries) ? If( __jsonGalleries as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGallery.FromJson(__u) )) ))() : null : _gallery;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.PowerShell.cs similarity index 62% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.PowerShell.cs index 80c98104e587..1e16a7fd5175 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookTemplateProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateProperties(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,29 +128,29 @@ internal WorkbookTemplateProperties(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("Priority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Author")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Author, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Author, global::System.Convert.ToString); } if (content.Contains("TemplateData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); } if (content.Contains("Gallery")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Gallery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Gallery, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Gallery = (System.Collections.Generic.List) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Gallery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); } if (content.Contains("Localized")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -167,23 +165,23 @@ internal WorkbookTemplateProperties(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("Priority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Author")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Author, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Author, global::System.Convert.ToString); } if (content.Contains("TemplateData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); } if (content.Contains("Gallery")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Gallery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Gallery, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Gallery = (System.Collections.Generic.List) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Gallery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); } if (content.Contains("Localized")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.TypeConverter.cs index 1861b1ac9b12..4b233aca095f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.cs similarity index 76% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.cs index 589140c099af..59533786167b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Properties that contain a workbook template. public partial class WorkbookTemplateProperties : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal { /// Backing field for property. @@ -22,22 +22,22 @@ public partial class WorkbookTemplateProperties : public string Author { get => this._author; set => this._author = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] _gallery; + private System.Collections.Generic.List _gallery; /// Workbook galleries supported by the template. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get => this._gallery; set => this._gallery = value; } + public System.Collections.Generic.List Gallery { get => this._gallery; set => this._gallery = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized _localized; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized _localized; /// /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get => (this._localized = this._localized ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesLocalized()); set => this._localized = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get => (this._localized = this._localized ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesLocalized()); set => this._localized = value; } /// Backing field for property. private int? _priority; @@ -50,12 +50,12 @@ public partial class WorkbookTemplateProperties : public int? Priority { get => this._priority; set => this._priority = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData _templateData; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData _templateData; /// Valid JSON object containing workbook template payload. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get => (this._templateData = this._templateData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTemplateData()); set => this._templateData = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get => (this._templateData = this._templateData ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTemplateData()); set => this._templateData = value; } /// Creates an new instance. public WorkbookTemplateProperties() @@ -71,6 +71,9 @@ public partial interface IWorkbookTemplateProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Information about the author of the workbook template.", SerializedName = @"author", PossibleTypes = new [] { typeof(string) })] @@ -79,26 +82,35 @@ public partial interface IWorkbookTemplateProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook galleries supported by the template.", SerializedName = @"galleries", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery) })] + System.Collections.Generic.List Gallery { get; set; } /// /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.", SerializedName = @"localized", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get; set; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.", SerializedName = @"priority", PossibleTypes = new [] { typeof(int) })] @@ -107,10 +119,13 @@ public partial interface IWorkbookTemplateProperties : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Valid JSON object containing workbook template payload.", SerializedName = @"templateData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } } /// Properties that contain a workbook template. @@ -120,17 +135,17 @@ internal partial interface IWorkbookTemplatePropertiesInternal /// Information about the author of the workbook template. string Author { get; set; } /// Workbook galleries supported by the template. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get; set; } + System.Collections.Generic.List Gallery { get; set; } /// /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get; set; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. /// int? Priority { get; set; } /// Valid JSON object containing workbook template payload. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.json.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.json.cs index abf89a458a96..875ab4fa475c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateProperties 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.Api20201120.IWorkbookTemplateProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateProperties(json) : null; } @@ -113,11 +113,11 @@ internal WorkbookTemplateProperties(Microsoft.Azure.PowerShell.Cmdlets.Applicati { return; } - {_priority = If( json?.PropertyT("priority"), out var __jsonPriority) ? (int?)__jsonPriority : Priority;} - {_author = If( json?.PropertyT("author"), out var __jsonAuthor) ? (string)__jsonAuthor : (string)Author;} - {_templateData = If( json?.PropertyT("templateData"), out var __jsonTemplateData) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTemplateData.FromJson(__jsonTemplateData) : TemplateData;} - {_gallery = If( json?.PropertyT("galleries"), out var __jsonGalleries) ? If( __jsonGalleries 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.Api20201120.IWorkbookTemplateGallery) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGallery.FromJson(__u) )) ))() : null : Gallery;} - {_localized = If( json?.PropertyT("localized"), out var __jsonLocalized) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesLocalized.FromJson(__jsonLocalized) : Localized;} + {_priority = If( json?.PropertyT("priority"), out var __jsonPriority) ? (int?)__jsonPriority : _priority;} + {_author = If( json?.PropertyT("author"), out var __jsonAuthor) ? (string)__jsonAuthor : (string)_author;} + {_templateData = If( json?.PropertyT("templateData"), out var __jsonTemplateData) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTemplateData.FromJson(__jsonTemplateData) : _templateData;} + {_gallery = If( json?.PropertyT("galleries"), out var __jsonGalleries) ? If( __jsonGalleries as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGallery.FromJson(__u) )) ))() : null : _gallery;} + {_localized = If( json?.PropertyT("localized"), out var __jsonLocalized) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesLocalized.FromJson(__jsonLocalized) : _localized;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.PowerShell.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.PowerShell.cs index d984306d8c0d..65cba59f6028 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class WorkbookTemplatePropertiesLocalized partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplatePropertiesLocalized DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplatePropertiesLocalized(content); } /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplatePropertiesLocalized DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplatePropertiesLocalized(content); } @@ -99,7 +99,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -119,7 +119,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -138,7 +138,7 @@ internal WorkbookTemplatePropertiesLocalized(global::System.Collections.IDiction } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.TypeConverter.cs index 59ae9fb48b3c..d813d3ac659e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.cs similarity index 85% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.cs index 85296fcaca1f..6808a725d6c3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201 /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// public partial class WorkbookTemplatePropertiesLocalized : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalizedInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalizedInternal { /// Creates an new instance. @@ -24,7 +24,7 @@ public WorkbookTemplatePropertiesLocalized() /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. public partial interface IWorkbookTemplatePropertiesLocalized : Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray> { } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.dictionary.cs new file mode 100644 index 000000000000..e86d6b498f74 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.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 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + public partial class WorkbookTemplatePropertiesLocalized : + 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 System.Collections.Generic.List this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, System.Collections.Generic.List 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 System.Collections.Generic.List value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesLocalized source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.json.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.json.cs index 2770f405b346..d66b965095d5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesLocalized.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesLocalized.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class WorkbookTemplatePropertiesLocalized 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.Api20201120.IWorkbookTemplatePropertiesLocalized. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplatePropertiesLocalized(json) : null; } @@ -87,7 +87,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, container); + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray>)this).AdditionalProperties, container); AfterToJson(ref container); return container; } @@ -105,7 +105,7 @@ internal WorkbookTemplatePropertiesLocalized(Microsoft.Azure.PowerShell.Cmdlets. { return; } - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray>)this).AdditionalProperties, null ,exclusions ); AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.PowerShell.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.PowerShell.cs index 6f25b376c50d..7c8763c07a81 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WorkbookTemplatePropertiesTemplateData partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplatePropertiesTemplateData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplatePropertiesTemplateData(content); } /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplatePropertiesTemplateData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplatePropertiesTemplateData(content); } @@ -98,7 +98,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -118,7 +118,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -137,7 +137,7 @@ internal WorkbookTemplatePropertiesTemplateData(global::System.Collections.IDict } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.TypeConverter.cs index cf3f21a48c0c..4775b1a23775 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.cs index debcaa50d0a7..4fa26d0b3405 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Valid JSON object containing workbook template payload. public partial class WorkbookTemplatePropertiesTemplateData : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateDataInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateDataInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.dictionary.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.dictionary.cs index 2ef606304183..f28b4c2e0bc5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTemplateData source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTemplateData source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.json.cs index 965d31aea33d..63dcf06f12e8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatePropertiesTemplateData.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatePropertiesTemplateData.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplatePropertiesTemplateData 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.Api20201120.IWorkbookTemplatePropertiesTemplateData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplatePropertiesTemplateData(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.PowerShell.cs similarity index 68% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.PowerShell.cs index 61700ea8dc88..c20e762c80ed 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbookTemplateResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateResource(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,29 +128,29 @@ internal WorkbookTemplateResource(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResourceTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -167,23 +165,23 @@ internal WorkbookTemplateResource(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResourceTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.TypeConverter.cs index 2a3504f44229..6fc03af15e3a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.cs similarity index 83% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.cs index e30456e4c8fb..06128063a067 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// An azure resource object public partial class WorkbookTemplateResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal { /// Backing field for property. @@ -30,13 +30,13 @@ public partial class WorkbookTemplateResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -47,12 +47,12 @@ public partial class WorkbookTemplateResource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -76,14 +76,20 @@ public partial interface IWorkbookTemplateResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource Id", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] string Id { get; } /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +98,9 @@ public partial interface IWorkbookTemplateResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -100,14 +109,20 @@ public partial interface IWorkbookTemplateResource : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags Tag { get; set; } /// Azure resource type [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource type", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -125,7 +140,7 @@ internal partial interface IWorkbookTemplateResourceInternal /// Azure resource name. string Name { get; set; } /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags Tag { get; set; } /// Azure resource type string Type { get; set; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.json.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.json.cs index 3d4ace9b6f48..8dca8e1c2556 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateResource 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.Api20201120.IWorkbookTemplateResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateResource(json) : null; } @@ -84,19 +84,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { 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 ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate)) + { + 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; @@ -114,11 +117,11 @@ internal WorkbookTemplateResource(Microsoft.Azure.PowerShell.Cmdlets.Application { 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.Api20201120.WorkbookTemplateResourceTags.FromJson(__jsonTags) : Tag;} + {_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.WorkbookTemplateResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.PowerShell.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.PowerShell.cs index d5adbb5d3e47..4bfbe0ee7821 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WorkbookTemplateResourceTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateResourceTags(content); } /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateResourceTags(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -134,7 +134,7 @@ internal WorkbookTemplateResourceTags(global::System.Collections.IDictionary con } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.TypeConverter.cs index e43cfdfa2c72..09506a3598f3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.cs index e90afb255e1f..961a95607dfb 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Resource tags public partial class WorkbookTemplateResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTagsInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.dictionary.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.dictionary.cs index 867d15a72731..7c619123e1fa 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.json.cs index 5eaa161338fb..31b2b0253490 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResourceTags.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateResourceTags 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.Api20201120.IWorkbookTemplateResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateResourceTags(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.PowerShell.cs similarity index 56% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.PowerShell.cs index 0eb7e796c6ba..58e804f624f8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WorkbookTemplateUpdateParameters partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateUpdateParameters(content); } /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateUpdateParameters(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,37 +130,37 @@ internal WorkbookTemplateUpdateParameters(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateUpdateParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateUpdateParametersTagsTypeConverter.ConvertFrom); } if (content.Contains("Priority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Author")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Author, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Author, global::System.Convert.ToString); } if (content.Contains("TemplateData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); } if (content.Contains("Gallery")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Gallery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Gallery, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Gallery = (System.Collections.Generic.List) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Gallery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); } if (content.Contains("Localized")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -175,31 +175,31 @@ internal WorkbookTemplateUpdateParameters(global::System.Management.Automation.P // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateUpdateParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateUpdateParametersTagsTypeConverter.ConvertFrom); } if (content.Contains("Priority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Priority = (int?) content.GetValueForProperty("Priority",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Priority, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Author")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Author, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Author = (string) content.GetValueForProperty("Author",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Author, global::System.Convert.ToString); } if (content.Contains("TemplateData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).TemplateData = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) content.GetValueForProperty("TemplateData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).TemplateData, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesTemplateDataTypeConverter.ConvertFrom); } if (content.Contains("Gallery")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Gallery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[]) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Gallery, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Gallery = (System.Collections.Generic.List) content.GetValueForProperty("Gallery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Gallery, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateGalleryTypeConverter.ConvertFrom)); } if (content.Contains("Localized")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Localized = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) content.GetValueForProperty("Localized",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal)this).Localized, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplatePropertiesLocalizedTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.TypeConverter.cs index 3bd3d76b63d5..119677efaf1a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.cs similarity index 67% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.cs index 06e4279a08af..c9d16952d454 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.cs @@ -3,63 +3,63 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// The parameters that can be provided when updating workbook template. public partial class WorkbookTemplateUpdateParameters : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal { /// Information about the author of the workbook template. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Author { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Author; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Author = value ?? null; } + public string Author { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Author; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Author = value ?? null; } /// Workbook galleries supported by the template. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Gallery; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Gallery = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Gallery { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Gallery; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Gallery = value ?? null /* arrayOf */; } /// /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Localized; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Localized = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Localized; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Localized = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateProperties()); set { {_property = value;} } } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public int? Priority { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Priority; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).Priority = value ?? default(int); } + public int? Priority { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Priority; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).Priority = value ?? default(int); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties _property; /// Metadata describing a workbook for an Azure resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateProperties()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateUpdateParametersTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateUpdateParametersTags()); set => this._tag = value; } /// Valid JSON object containing workbook template payload. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).TemplateData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesInternal)Property).TemplateData = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).TemplateData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesInternal)Property).TemplateData = value ?? null /* model class */; } /// Creates an new instance. public WorkbookTemplateUpdateParameters() @@ -75,6 +75,9 @@ public partial interface IWorkbookTemplateUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Information about the author of the workbook template.", SerializedName = @"author", PossibleTypes = new [] { typeof(string) })] @@ -83,26 +86,35 @@ public partial interface IWorkbookTemplateUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook galleries supported by the template.", SerializedName = @"galleries", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery) })] + System.Collections.Generic.List Gallery { get; set; } /// /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.", SerializedName = @"localized", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get; set; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.", SerializedName = @"priority", PossibleTypes = new [] { typeof(int) })] @@ -111,18 +123,24 @@ public partial interface IWorkbookTemplateUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags Tag { get; set; } /// Valid JSON object containing workbook template payload. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Valid JSON object containing workbook template payload.", SerializedName = @"templateData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } } /// The parameters that can be provided when updating workbook template. @@ -132,21 +150,21 @@ internal partial interface IWorkbookTemplateUpdateParametersInternal /// Information about the author of the workbook template. string Author { get; set; } /// Workbook galleries supported by the template. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get; set; } + System.Collections.Generic.List Gallery { get; set; } /// /// Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get; set; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. /// int? Priority { get; set; } /// Metadata describing a workbook for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateProperties Property { get; set; } /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags Tag { get; set; } /// Valid JSON object containing workbook template payload. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.json.cs index 16b821fcd939..c05bfa079802 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateUpdateParameters 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.Api20201120.IWorkbookTemplateUpdateParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateUpdateParameters(json) : null; } @@ -102,8 +102,8 @@ internal WorkbookTemplateUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.App { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateUpdateParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateUpdateParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.PowerShell.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.PowerShell.cs index be5f87cfcd09..3aef5b1bfb46 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WorkbookTemplateUpdateParametersTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplateUpdateParametersTags(content); } /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplateUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplateUpdateParametersTags(content); } @@ -97,7 +97,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -117,7 +117,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -136,7 +136,7 @@ internal WorkbookTemplateUpdateParametersTags(global::System.Collections.IDictio } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.TypeConverter.cs index b51b60e45753..619bafaee067 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.cs index faa9ded994dd..1769a7f21ca5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Resource tags public partial class WorkbookTemplateUpdateParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTagsInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.dictionary.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.dictionary.cs index d7a0844fe611..5db21ed75c92 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateUpdateParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateUpdateParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.json.cs similarity index 95% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.json.cs index d244bbe4a548..fe7044a4dc94 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParametersTags.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParametersTags.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplateUpdateParametersTags 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.Api20201120.IWorkbookTemplateUpdateParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplateUpdateParametersTags(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.PowerShell.cs similarity index 78% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.PowerShell.cs index 707e8a5e8dc8..1c73d480ddcd 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WorkbookTemplatesListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplatesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookTemplatesListResult(content); } /// - /// Deserializes a into an instance of 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.Api20201120.IWorkbookTemplatesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookTemplatesListResult(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,13 +130,13 @@ internal WorkbookTemplatesListResult(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -151,7 +151,7 @@ internal WorkbookTemplatesListResult(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.TypeConverter.cs index 2ecb6b38bf0c..014ae5113bd2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.cs similarity index 70% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.cs index 6eff864343c1..c36c3d3de52b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.cs @@ -3,23 +3,23 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// WorkbookTemplate list result. public partial class WorkbookTemplatesListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResult, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResultInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate[] _value; + private System.Collections.Generic.List _value; /// An array of workbook templates. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public WorkbookTemplatesListResult() @@ -35,10 +35,13 @@ public partial interface IWorkbookTemplatesListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An array of workbook templates.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate) })] + System.Collections.Generic.List Value { get; set; } } /// WorkbookTemplate list result. @@ -46,7 +49,7 @@ internal partial interface IWorkbookTemplatesListResultInternal { /// An array of workbook templates. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.json.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.json.cs index 5254cf9c35e1..9aea21e30e77 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20201120 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookTemplatesListResult 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.Api20201120.IWorkbookTemplatesListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookTemplatesListResult(json) : null; } @@ -109,7 +109,7 @@ internal WorkbookTemplatesListResult(Microsoft.Azure.PowerShell.Cmdlets.Applicat { 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.Api20201120.IWorkbookTemplate) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplate.FromJson(__u) )) ))() : null : Value;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.PowerShell.cs similarity index 58% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.PowerShell.cs index c5fd094eec25..c6760d8cba44 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class WorkbookUpdateParameters partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookUpdateParameters(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookUpdateParameters(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -117,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -132,45 +130,45 @@ internal WorkbookUpdateParameters(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookPropertiesUpdateParametersTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookPropertiesUpdateParametersTypeConverter.ConvertFrom); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParametersTagsTypeConverter.ConvertFrom); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("SerializedData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).SerializedData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).SerializedData, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("PropertiesTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).PropertiesTag = (string[]) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).PropertiesTag = (System.Collections.Generic.List) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Revision, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Revision, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -185,39 +183,39 @@ internal WorkbookUpdateParameters(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookPropertiesUpdateParametersTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookPropertiesUpdateParametersTypeConverter.ConvertFrom); } if (content.Contains("Kind")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Kind, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParametersTagsTypeConverter.ConvertFrom); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("SerializedData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).SerializedData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).SerializedData = (string) content.GetValueForProperty("SerializedData",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).SerializedData, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("PropertiesTag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).PropertiesTag = (string[]) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).PropertiesTag = (System.Collections.Generic.List) content.GetValueForProperty("PropertiesTag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).PropertiesTag, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal)this).Revision, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Revision, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.TypeConverter.cs index 872c9b2db744..13d92ca149f9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.cs similarity index 70% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.cs index d10f15965b99..820e44da3f87 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -11,68 +11,68 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220 /// The parameters that can be provided when updating workbook properties properties. /// public partial class WorkbookUpdateParameters : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal { /// Workbook category, as defined by the user at creation time. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 5)] - public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).Category = value ?? null; } + public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).Category = value ?? null; } /// The description of the workbook. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).Description = value ?? null; } /// The user-defined name (display name) of the workbook. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 2)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).DisplayName = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind? _kind; + private string _kind; /// The kind of workbook. Only valid value is shared. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 4)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind? Kind { get => this._kind; set => this._kind = value; } + public string Kind { get => this._kind; set => this._kind = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookPropertiesUpdateParameters()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookPropertiesUpdateParameters()); set { {_property = value;} } } /// A list of 0 or more tags that are associated with this workbook definition [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string[] PropertiesTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).Tag = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PropertiesTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).Tag = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters _property; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters _property; /// Metadata describing a workbook for an Azure resource. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookPropertiesUpdateParameters()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookPropertiesUpdateParameters()); set => this._property = value; } /// The unique revision id for this workbook definition [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).Revision = value ?? null; } + public string Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).Revision = value ?? null; } /// /// Configuration of this particular workbook. Configuration data is a string containing valid JSON /// [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string SerializedData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).SerializedData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParametersInternal)Property).SerializedData = value ?? null; } + public string SerializedData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).SerializedData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).SerializedData = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParametersTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParametersTags()); set => this._tag = value; } /// Creates an new instance. public WorkbookUpdateParameters() @@ -88,6 +88,9 @@ public partial interface IWorkbookUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Workbook category, as defined by the user at creation time.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -96,6 +99,9 @@ public partial interface IWorkbookUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the workbook.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -104,6 +110,9 @@ public partial interface IWorkbookUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user-defined name (display name) of the workbook.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -112,22 +121,32 @@ public partial interface IWorkbookUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The kind of workbook. Only valid value is shared.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind? Kind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("shared")] + string Kind { get; set; } /// A list of 0 or more tags that are associated with this workbook definition [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of 0 or more tags that are associated with this workbook definition", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - string[] PropertiesTag { get; set; } + System.Collections.Generic.List PropertiesTag { get; set; } /// The unique revision id for this workbook definition [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The unique revision id for this workbook definition", SerializedName = @"revision", PossibleTypes = new [] { typeof(string) })] @@ -138,6 +157,9 @@ public partial interface IWorkbookUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Configuration of this particular workbook. Configuration data is a string containing valid JSON", SerializedName = @"serializedData", PossibleTypes = new [] { typeof(string) })] @@ -146,10 +168,13 @@ public partial interface IWorkbookUpdateParameters : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags Tag { get; set; } } /// The parameters that can be provided when updating workbook properties properties. @@ -163,11 +188,12 @@ internal partial interface IWorkbookUpdateParametersInternal /// The user-defined name (display name) of the workbook. string DisplayName { get; set; } /// The kind of workbook. Only valid value is shared. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind? Kind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("shared")] + string Kind { get; set; } /// A list of 0 or more tags that are associated with this workbook definition - string[] PropertiesTag { get; set; } + System.Collections.Generic.List PropertiesTag { get; set; } /// Metadata describing a workbook for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters Property { get; set; } /// The unique revision id for this workbook definition string Revision { get; set; } /// @@ -175,7 +201,7 @@ internal partial interface IWorkbookUpdateParametersInternal /// string SerializedData { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.json.cs similarity index 93% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.json.cs index b31bc7c23f28..0946e1aeb774 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class WorkbookUpdateParameters 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.Api20220401.IWorkbookUpdateParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookUpdateParameters(json) : null; } @@ -105,9 +105,9 @@ internal WorkbookUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Application { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookPropertiesUpdateParameters.FromJson(__jsonProperties) : Property;} - {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookPropertiesUpdateParameters.FromJson(__jsonProperties) : _property;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)_kind;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.PowerShell.cs similarity index 88% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.PowerShell.cs index 3f9cb6d22a9b..48ca59e52803 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WorkbookUpdateParametersTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Api20220401.IWorkbookUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbookUpdateParametersTags(content); } /// - /// Deserializes a into an instance of 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.Api20220401.IWorkbookUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbookUpdateParametersTags(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -134,7 +134,7 @@ internal WorkbookUpdateParametersTags(global::System.Collections.IDictionary con } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.TypeConverter.cs index 5858278e1302..c6b3109f5965 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.cs similarity index 90% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.cs index 5151a6b8f18f..847bac03d749 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.cs @@ -3,14 +3,14 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Resource tags. public partial class WorkbookUpdateParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTagsInternal { /// Creates an new instance. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.dictionary.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.dictionary.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.dictionary.cs index dec4da50f6d9..d11545d4776a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.dictionary.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.json.cs similarity index 96% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.json.cs index 1dde0af40007..17c829822c7a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParametersTags.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParametersTags.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbookUpdateParametersTags 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.Api20220401.IWorkbookUpdateParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbookUpdateParametersTags(json) : null; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.PowerShell.cs similarity index 75% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.PowerShell.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.PowerShell.cs index d0c0e2033028..1530020653a9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.PowerShell.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkbooksListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkbooksListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkbooksListResult(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,17 +128,17 @@ internal WorkbooksListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -155,11 +153,11 @@ internal WorkbooksListResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.TypeConverter.cs similarity index 97% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.TypeConverter.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.TypeConverter.cs index fe7135ba1cca..64d9d49c130a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.TypeConverter.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.cs similarity index 71% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.cs index 942b08f1275a..2acd65a9317c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.cs @@ -3,18 +3,18 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; /// Workbook list result. public partial class WorkbooksListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal { /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -24,12 +24,12 @@ public partial class WorkbooksListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook[] _value; + private System.Collections.Generic.List _value; /// An array of workbooks. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkbooksListResult() @@ -44,6 +44,9 @@ public partial interface IWorkbooksListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,13 @@ public partial interface IWorkbooksListResult : [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"An array of workbooks.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook) })] + System.Collections.Generic.List Value { get; } } /// Workbook list result. @@ -64,7 +70,7 @@ internal partial interface IWorkbooksListResultInternal { string NextLink { get; set; } /// An array of workbooks. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.json.cs similarity index 91% rename from generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.json.cs rename to generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.json.cs index 4cd12ad415cb..a82b6aa5aa46 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.json.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by 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.Api20220401 +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkbooksListResult 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.Api20220401.IWorkbooksListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new WorkbooksListResult(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,8 +113,8 @@ internal WorkbooksListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsig { 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.Api20220401.IWorkbook) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.Workbook.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_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.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook) (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.Completer.cs deleted file mode 100644 index 9180a803adcc..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.TypeConverter.cs deleted file mode 100644 index fb3d6a338d02..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.cs deleted file mode 100644 index 07b18d6cb43e..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ApplicationType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 Enum class. - /// 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CategoryType.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CategoryType.Completer.cs deleted file mode 100644 index a27b1d04aca8..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CategoryType.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 CategoryType. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryTypeTypeConverter))] - public partial struct CategoryType : - 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) || "workbook".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'workbook'", "workbook", global::System.Management.Automation.CompletionResultType.ParameterValue, "workbook"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TSG".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TSG'", "TSG", global::System.Management.Automation.CompletionResultType.ParameterValue, "TSG"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "performance".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'performance'", "performance", global::System.Management.Automation.CompletionResultType.ParameterValue, "performance"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "retention".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'retention'", "retention", global::System.Management.Automation.CompletionResultType.ParameterValue, "retention"); - } - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CategoryType.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CategoryType.TypeConverter.cs deleted file mode 100644 index 0f9b0320feee..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CategoryType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 CategoryType. - public partial class CategoryTypeTypeConverter : - 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) => CategoryType.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CategoryType.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CategoryType.cs deleted file mode 100644 index bba626f13717..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CategoryType.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 CategoryType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType Performance = @"performance"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType Retention = @"retention"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType Tsg = @"TSG"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType Workbook = @"workbook"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CategoryType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CategoryType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CategoryType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CategoryType - /// 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.CategoryType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CategoryType (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 CategoryType && Equals((CategoryType)obj); - } - - /// Returns hashCode for enum CategoryType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CategoryType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CategoryType - /// the value to convert to an instance of . - - public static implicit operator CategoryType(string value) - { - return new CategoryType(value); - } - - /// Implicit operator to convert CategoryType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType e) - { - return e._value; - } - - /// Overriding != operator for enum CategoryType - /// 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.CategoryType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CategoryType - /// 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.CategoryType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index e5ee6832f18d..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CreatedByType.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByTypeTypeConverter))] - public partial struct CreatedByType : - 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) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); - } - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index 1a161de4efa3..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 type of identity that created the resource. - public partial class CreatedByTypeTypeConverter : - 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) => CreatedByType.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CreatedByType.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index af37f8b85f8a..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/CreatedByType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to CreatedByType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CreatedByType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CreatedByType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type CreatedByType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CreatedByType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is CreatedByType && Equals((CreatedByType)obj); - } - - /// Returns hashCode for enum CreatedByType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CreatedByType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CreatedByType - /// the value to convert to an instance of . - - public static implicit operator CreatedByType(string value) - { - return new CreatedByType(value); - } - - /// Implicit operator to convert CreatedByType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType e) - { - return e._value; - } - - /// Overriding != operator for enum CreatedByType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CreatedByType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.Completer.cs deleted file mode 100644 index 2e254b6d1433..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.Completer.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.TypeConverter.cs deleted file mode 100644 index 59c9961ef125..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.TypeConverter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.cs deleted file mode 100644 index 33d36fab625c..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/FlowType.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 Enum class. - /// 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.Completer.cs deleted file mode 100644 index f633df2e6d5e..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.TypeConverter.cs deleted file mode 100644 index b5b6fa1ec660..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.cs deleted file mode 100644 index 014257fd5c40..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/IngestionMode.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 Enum class. - /// 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/Kind.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/Kind.Completer.cs deleted file mode 100644 index 7a6374e0ca9d..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/Kind.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of workbook. Choices are user and shared. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.KindTypeConverter))] - public partial struct Kind : - 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) || "user".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'user'", "user", global::System.Management.Automation.CompletionResultType.ParameterValue, "user"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "shared".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'shared'", "shared", global::System.Management.Automation.CompletionResultType.ParameterValue, "shared"); - } - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/Kind.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/Kind.TypeConverter.cs deleted file mode 100644 index 8a2374e64d18..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/Kind.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of workbook. Choices are user and shared. - public partial class KindTypeConverter : - 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) => Kind.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/Kind.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/Kind.cs deleted file mode 100644 index 1e2c105f7913..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/Kind.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of workbook. Choices are user and shared. - public partial struct Kind : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind Shared = @"shared"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind User = @"user"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Kind - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Kind(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Kind - /// 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.Kind e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Kind (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 Kind && Equals((Kind)obj); - } - - /// Returns hashCode for enum Kind - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private Kind(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Kind - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Kind - /// the value to convert to an instance of . - - public static implicit operator Kind(string value) - { - return new Kind(value); - } - - /// Implicit operator to convert Kind to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind e) - { - return e._value; - } - - /// Overriding != operator for enum Kind - /// 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.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Kind - /// 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.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ManagedServiceIdentityType.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ManagedServiceIdentityType.Completer.cs deleted file mode 100644 index ef66364a5b28..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ManagedServiceIdentityType.Completer.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityTypeTypeConverter))] - public partial struct ManagedServiceIdentityType : - 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) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned'", "SystemAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UserAssigned'", "UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssigned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned,UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned,UserAssigned'", "SystemAssigned,UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned,UserAssigned"); - } - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ManagedServiceIdentityType.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ManagedServiceIdentityType.TypeConverter.cs deleted file mode 100644 index c15bde88f496..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ManagedServiceIdentityType.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - public partial class ManagedServiceIdentityTypeTypeConverter : - 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) => ManagedServiceIdentityType.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ManagedServiceIdentityType.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ManagedServiceIdentityType.cs deleted file mode 100644 index 1c2ea1015ddd..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/ManagedServiceIdentityType.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - public partial struct ManagedServiceIdentityType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType SystemAssigned = @"SystemAssigned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType SystemAssignedUserAssigned = @"SystemAssigned,UserAssigned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType UserAssigned = @"UserAssigned"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ManagedServiceIdentityType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ManagedServiceIdentityType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ManagedServiceIdentityType - /// 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.ManagedServiceIdentityType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ManagedServiceIdentityType (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 ManagedServiceIdentityType && Equals((ManagedServiceIdentityType)obj); - } - - /// Returns hashCode for enum ManagedServiceIdentityType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ManagedServiceIdentityType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ManagedServiceIdentityType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ManagedServiceIdentityType - /// the value to convert to an instance of . - - public static implicit operator ManagedServiceIdentityType(string value) - { - return new ManagedServiceIdentityType(value); - } - - /// Implicit operator to convert ManagedServiceIdentityType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType e) - { - return e._value; - } - - /// Overriding != operator for enum ManagedServiceIdentityType - /// 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.ManagedServiceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ManagedServiceIdentityType - /// 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.ManagedServiceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.Completer.cs deleted file mode 100644 index f0185308614e..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.Completer.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.TypeConverter.cs deleted file mode 100644 index f37924eb8c4d..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.cs deleted file mode 100644 index a919e11ee8d6..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PublicNetworkAccessType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 Enum class. - /// 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.Completer.cs deleted file mode 100644 index 247312f0d43a..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.TypeConverter.cs deleted file mode 100644 index 8b925de6c4d6..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.cs deleted file mode 100644 index 3df32ded4336..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/PurgeState.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 Enum class. - /// 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.Completer.cs deleted file mode 100644 index 320704e07db9..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.Completer.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.TypeConverter.cs deleted file mode 100644 index 57445c9c8598..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.TypeConverter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.cs deleted file mode 100644 index 11549effc9ff..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/RequestSource.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 Enum class. - /// 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.Completer.cs deleted file mode 100644 index cb34008f7c13..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.Completer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.TypeConverter.cs deleted file mode 100644 index 6023eec03540..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.cs deleted file mode 100644 index 817ad7ebc6fb..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/StorageType.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 Enum class. - /// 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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKind.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKind.Completer.cs deleted file mode 100644 index dc681477b920..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKind.Completer.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of WebTest that this web test watches. Choices are ping, multistep and standard. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindTypeConverter))] - public partial struct WebTestKind : - 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) || "ping".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ping'", "ping", global::System.Management.Automation.CompletionResultType.ParameterValue, "ping"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "multistep".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'multistep'", "multistep", global::System.Management.Automation.CompletionResultType.ParameterValue, "multistep"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "standard".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'standard'", "standard", global::System.Management.Automation.CompletionResultType.ParameterValue, "standard"); - } - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKind.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKind.TypeConverter.cs deleted file mode 100644 index 19bb08b90291..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKind.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of WebTest that this web test watches. Choices are ping, multistep and standard. - /// - public partial class WebTestKindTypeConverter : - 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) => WebTestKind.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKind.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKind.cs deleted file mode 100644 index d2fca3839bce..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKind.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of WebTest that this web test watches. Choices are ping, multistep and standard. - /// - public partial struct WebTestKind : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind Multistep = @"multistep"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind Ping = @"ping"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind Standard = @"standard"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to WebTestKind - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WebTestKind(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WebTestKind - /// 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.WebTestKind e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type WebTestKind (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 WebTestKind && Equals((WebTestKind)obj); - } - - /// Returns hashCode for enum WebTestKind - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WebTestKind - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private WebTestKind(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WebTestKind - /// the value to convert to an instance of . - - public static implicit operator WebTestKind(string value) - { - return new WebTestKind(value); - } - - /// Implicit operator to convert WebTestKind to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind e) - { - return e._value; - } - - /// Overriding != operator for enum WebTestKind - /// 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.WebTestKind e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WebTestKind - /// 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.WebTestKind e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKindEnum.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKindEnum.Completer.cs deleted file mode 100644 index c35661a4a8e2..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKindEnum.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of web test this is, valid choices are ping, multistep, and standard. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnumTypeConverter))] - public partial struct WebTestKindEnum : - 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) || "ping".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ping'", "ping", global::System.Management.Automation.CompletionResultType.ParameterValue, "ping"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "multistep".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'multistep'", "multistep", global::System.Management.Automation.CompletionResultType.ParameterValue, "multistep"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "standard".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'standard'", "standard", global::System.Management.Automation.CompletionResultType.ParameterValue, "standard"); - } - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKindEnum.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKindEnum.TypeConverter.cs deleted file mode 100644 index 17f22202d767..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKindEnum.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of web test this is, valid choices are ping, multistep, and standard. - public partial class WebTestKindEnumTypeConverter : - 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) => WebTestKindEnum.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKindEnum.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKindEnum.cs deleted file mode 100644 index cb195336d0a5..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WebTestKindEnum.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of web test this is, valid choices are ping, multistep, and standard. - public partial struct WebTestKindEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum Multistep = @"multistep"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum Ping = @"ping"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum Standard = @"standard"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to WebTestKindEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WebTestKindEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WebTestKindEnum - /// 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.WebTestKindEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type WebTestKindEnum (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 WebTestKindEnum && Equals((WebTestKindEnum)obj); - } - - /// Returns hashCode for enum WebTestKindEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WebTestKindEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private WebTestKindEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WebTestKindEnum - /// the value to convert to an instance of . - - public static implicit operator WebTestKindEnum(string value) - { - return new WebTestKindEnum(value); - } - - /// Implicit operator to convert WebTestKindEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum e) - { - return e._value; - } - - /// Overriding != operator for enum WebTestKindEnum - /// 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.WebTestKindEnum e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WebTestKindEnum - /// 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.WebTestKindEnum e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookSharedTypeKind.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookSharedTypeKind.Completer.cs deleted file mode 100644 index f482a3c6c551..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookSharedTypeKind.Completer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of workbook. Only valid value is shared. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKindTypeConverter))] - public partial struct WorkbookSharedTypeKind : - 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) || "shared".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'shared'", "shared", global::System.Management.Automation.CompletionResultType.ParameterValue, "shared"); - } - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookSharedTypeKind.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookSharedTypeKind.TypeConverter.cs deleted file mode 100644 index fbd78a12830c..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookSharedTypeKind.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of workbook. Only valid value is shared. - public partial class WorkbookSharedTypeKindTypeConverter : - 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) => WorkbookSharedTypeKind.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookSharedTypeKind.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookSharedTypeKind.cs deleted file mode 100644 index 8da278dbad12..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookSharedTypeKind.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of workbook. Only valid value is shared. - public partial struct WorkbookSharedTypeKind : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind Shared = @"shared"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to WorkbookSharedTypeKind - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkbookSharedTypeKind(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkbookSharedTypeKind - /// 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.WorkbookSharedTypeKind e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type WorkbookSharedTypeKind (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 WorkbookSharedTypeKind && Equals((WorkbookSharedTypeKind)obj); - } - - /// Returns hashCode for enum WorkbookSharedTypeKind - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkbookSharedTypeKind - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private WorkbookSharedTypeKind(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WorkbookSharedTypeKind - /// the value to convert to an instance of . - - public static implicit operator WorkbookSharedTypeKind(string value) - { - return new WorkbookSharedTypeKind(value); - } - - /// Implicit operator to convert WorkbookSharedTypeKind to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind e) - { - return e._value; - } - - /// Overriding != operator for enum WorkbookSharedTypeKind - /// 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.WorkbookSharedTypeKind e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkbookSharedTypeKind - /// 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.WorkbookSharedTypeKind e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookUpdateSharedTypeKind.Completer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookUpdateSharedTypeKind.Completer.cs deleted file mode 100644 index 8c536ef134fb..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookUpdateSharedTypeKind.Completer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of workbook. Only valid value is shared. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKindTypeConverter))] - public partial struct WorkbookUpdateSharedTypeKind : - 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) || "shared".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'shared'", "shared", global::System.Management.Automation.CompletionResultType.ParameterValue, "shared"); - } - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookUpdateSharedTypeKind.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookUpdateSharedTypeKind.TypeConverter.cs deleted file mode 100644 index a0357fb67acb..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookUpdateSharedTypeKind.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of workbook. Only valid value is shared. - public partial class WorkbookUpdateSharedTypeKindTypeConverter : - 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) => WorkbookUpdateSharedTypeKind.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/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookUpdateSharedTypeKind.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookUpdateSharedTypeKind.cs deleted file mode 100644 index d5bef59c37bd..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Support/WorkbookUpdateSharedTypeKind.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by 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 kind of workbook. Only valid value is shared. - public partial struct WorkbookUpdateSharedTypeKind : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind Shared = @"shared"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to WorkbookUpdateSharedTypeKind - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkbookUpdateSharedTypeKind(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkbookUpdateSharedTypeKind - /// 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.WorkbookUpdateSharedTypeKind e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type WorkbookUpdateSharedTypeKind (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 WorkbookUpdateSharedTypeKind && Equals((WorkbookUpdateSharedTypeKind)obj); - } - - /// Returns hashCode for enum WorkbookUpdateSharedTypeKind - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkbookUpdateSharedTypeKind - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private WorkbookUpdateSharedTypeKind(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WorkbookUpdateSharedTypeKind - /// the value to convert to an instance of . - - public static implicit operator WorkbookUpdateSharedTypeKind(string value) - { - return new WorkbookUpdateSharedTypeKind(value); - } - - /// Implicit operator to convert WorkbookUpdateSharedTypeKind to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind e) - { - return e._value; - } - - /// Overriding != operator for enum WorkbookUpdateSharedTypeKind - /// 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.WorkbookUpdateSharedTypeKind e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkbookUpdateSharedTypeKind - /// 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.WorkbookUpdateSharedTypeKind e1, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_Purge.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_Purge.cs index 7871008d9c34..0ee16c6bd001 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_Purge.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_Purge.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -22,12 +24,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse))] [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.\nNote: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , scoped to specific resource id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge", ApiVersion = "2020-02-02")] public partial class ClearAzApplicationInsights_Purge : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -43,8 +46,20 @@ public partial class ClearAzApplicationInsights_Purge : global::System.Managemen /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody _body; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)] @@ -53,14 +68,18 @@ public partial class ClearAzApplicationInsights_Purge : global::System.Managemen 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -74,6 +93,9 @@ public partial class ClearAzApplicationInsights_Purge : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -115,7 +137,7 @@ public partial class ClearAzApplicationInsights_Purge : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -161,7 +183,8 @@ public partial class ClearAzApplicationInsights_Purge : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -170,24 +193,24 @@ public partial class ClearAzApplicationInsights_Purge : global::System.Managemen /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse /// 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); + 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + 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) @@ -208,7 +231,7 @@ protected override void BeginProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public ClearAzApplicationInsights_Purge() { @@ -218,6 +241,11 @@ public ClearAzApplicationInsights_Purge() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -282,8 +310,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -339,7 +392,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -352,12 +405,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.ComponentsPurge(ResourceGroupName, SubscriptionId, Name, Body, onAccepted, onDefault, this, Pipeline); + await this.Client.ComponentsPurge(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -393,12 +446,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse /// 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) + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onAccepted - response for 202 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse - WriteObject((await response).OperationId); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -419,12 +490,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -441,15 +512,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=Body }) + 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 } }); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeExpanded.cs index 4441715ffe04..1726f9caf813 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -22,12 +24,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse))] [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.\nNote: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , scoped to specific resource id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge", ApiVersion = "2020-02-02")] public partial class ClearAzApplicationInsights_PurgeExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -39,18 +42,33 @@ public partial class ClearAzApplicationInsights_PurgeExpanded : global::System.M 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody _body = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeBody(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -64,6 +82,9 @@ public partial class ClearAzApplicationInsights_PurgeExpanded : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// /// The set of columns and filters (queries) to run over them to purge the resulting data. /// @@ -75,8 +96,8 @@ public partial class ClearAzApplicationInsights_PurgeExpanded : global::System.M 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters[] Filter { get => _body.Filter?.ToArray() ?? null /* fixedArrayOf */; set => _body.Filter = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -119,7 +140,7 @@ public partial class ClearAzApplicationInsights_PurgeExpanded : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -165,7 +186,8 @@ public partial class ClearAzApplicationInsights_PurgeExpanded : global::System.M [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -185,24 +207,24 @@ public partial class ClearAzApplicationInsights_PurgeExpanded : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse /// 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); + 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + 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) @@ -223,7 +245,7 @@ protected override void BeginProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public ClearAzApplicationInsights_PurgeExpanded() { @@ -233,6 +255,11 @@ public ClearAzApplicationInsights_PurgeExpanded() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -297,8 +324,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -354,7 +406,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -367,12 +419,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.ComponentsPurge(ResourceGroupName, SubscriptionId, Name, _body, onAccepted, onDefault, this, Pipeline); + await this.Client.ComponentsPurge(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -408,12 +460,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse /// 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) + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -425,8 +477,26 @@ protected override void StopProcessing() return ; } // onAccepted - response for 202 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse - WriteObject((await response).OperationId); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -434,12 +504,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -456,15 +526,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_body }) + 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 } }); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentity.cs index 8d83c7774eb2..f86646838494 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -22,12 +24,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse))] [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.\nNote: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , scoped to specific resource id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge", ApiVersion = "2020-02-02")] public partial class ClearAzApplicationInsights_PurgeViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -43,8 +46,20 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentity : global::Syste /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody _body; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)] @@ -53,14 +68,18 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentity : global::Syste 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -74,6 +93,9 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentity : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -108,7 +130,7 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentity : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -131,24 +153,24 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentity : global::Syste /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse /// 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); + 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + 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) @@ -169,7 +191,7 @@ protected override void BeginProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public ClearAzApplicationInsights_PurgeViaIdentity() { @@ -179,6 +201,11 @@ public ClearAzApplicationInsights_PurgeViaIdentity() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -243,8 +270,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -300,7 +352,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -320,25 +372,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentsPurge(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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}) + 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 } }); @@ -374,12 +426,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse /// 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) + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,8 +443,26 @@ protected override void StopProcessing() return ; } // onAccepted - response for 202 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse - WriteObject((await response).OperationId); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -400,12 +470,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -422,15 +492,15 @@ protected override void StopProcessing() 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 }) + 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 { body=Body }) + 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 } }); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentityExpanded.cs index 7170f16b3f58..508e916855ab 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentityExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -22,12 +24,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse))] [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.\nNote: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , scoped to specific resource id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge", ApiVersion = "2020-02-02")] public partial class ClearAzApplicationInsights_PurgeViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -39,18 +42,33 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentityExpanded : globa 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody _body = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentPurgeBody(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -64,6 +82,9 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentityExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// /// The set of columns and filters (queries) to run over them to purge the resulting data. /// @@ -75,8 +96,8 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentityExpanded : globa 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters[] Filter { get => _body.Filter?.ToArray() ?? null /* fixedArrayOf */; set => _body.Filter = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -112,7 +133,7 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentityExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -146,24 +167,24 @@ public partial class ClearAzApplicationInsights_PurgeViaIdentityExpanded : globa /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse /// 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); + 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + 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) @@ -184,7 +205,7 @@ protected override void BeginProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public ClearAzApplicationInsights_PurgeViaIdentityExpanded() { @@ -194,6 +215,11 @@ public ClearAzApplicationInsights_PurgeViaIdentityExpanded() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -258,8 +284,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -315,7 +366,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,25 +386,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentsPurge(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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}) + 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 } }); @@ -389,12 +440,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse /// 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) + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -406,8 +457,26 @@ protected override void StopProcessing() return ; } // onAccepted - response for 202 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeResponse - WriteObject((await response).OperationId); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -415,12 +484,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -437,15 +506,15 @@ protected override void StopProcessing() 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 }) + 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 { body=_body }) + 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 } }); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaJsonFilePath.cs new file mode 100644 index 000000000000..528045a5cb13 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaJsonFilePath.cs @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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.\nNote: this operation + /// is intended for Classic resources, for workspace-based Application Insights resource please run purge operation (directly + /// on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , scoped to specific resource + /// id. + /// + /// + /// [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_PurgeViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse))] + [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.\nNote: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , scoped to specific resource id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge", ApiVersion = "2020-02-02")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class ClearAzApplicationInsights_PurgeViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Purge operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Purge operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Purge operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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; } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public ClearAzApplicationInsights_PurgeViaJsonFilePath() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentsPurgeViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse + /// 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.IComponentPurgeResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaJsonString.cs new file mode 100644 index 000000000000..bfd5054e88b0 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/ClearAzApplicationInsights_PurgeViaJsonString.cs @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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.\nNote: this operation + /// is intended for Classic resources, for workspace-based Application Insights resource please run purge operation (directly + /// on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , scoped to specific resource + /// id. + /// + /// + /// [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_PurgeViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse))] + [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.\nNote: this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge operation (directly on the workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , scoped to specific resource id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge", ApiVersion = "2020-02-02")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class ClearAzApplicationInsights_PurgeViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Purge operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Purge operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Purge operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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; } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public ClearAzApplicationInsights_PurgeViaJsonString() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentsPurgeViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse + /// 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.IComponentPurgeResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_Get.cs index 96bcdd37e7c5..44581a37bd12 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get the annotation for given id. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the annotation for given id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsAnnotation_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsAnnotation_Get : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsAnnotation_Get : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -96,7 +117,7 @@ public partial class GetAzApplicationInsightsAnnotation_Get : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -156,7 +177,8 @@ public partial class GetAzApplicationInsightsAnnotation_Get : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -165,24 +187,24 @@ public partial class GetAzApplicationInsightsAnnotation_Get : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -205,6 +227,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -226,7 +253,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsAnnotation_Get() { @@ -277,8 +304,33 @@ public GetAzApplicationInsightsAnnotation_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -331,7 +383,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -346,13 +398,13 @@ protected override void ProcessRecord() 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 this.Client.AnnotationsGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,Id=Id}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -390,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,15 +464,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, Id=Id }) + 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 } }); @@ -430,12 +482,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -447,9 +499,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentity.cs index e672f62e298a..d00ef45e6f1d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get the annotation for given id. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the annotation for given id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsAnnotation_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsAnnotation_GetViaIdentity : global: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsAnnotation_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +108,7 @@ public partial class GetAzApplicationInsightsAnnotation_GetViaIdentity : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,24 +131,24 @@ public partial class GetAzApplicationInsightsAnnotation_GetViaIdentity : global: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -150,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsAnnotation_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzApplicationInsightsAnnotation_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -296,14 +347,14 @@ protected override void ProcessRecord() 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.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.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) ); @@ -312,13 +363,13 @@ protected override void ProcessRecord() { 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 this.Client.AnnotationsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -356,12 +407,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -378,7 +429,7 @@ protected override void StopProcessing() 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); + 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 } @@ -396,12 +447,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -413,9 +464,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentityComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentityComponent.cs new file mode 100644 index 000000000000..f31c1cf13722 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_GetViaIdentityComponent.cs @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_GetViaIdentityComponent")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the annotation for given id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}", ApiVersion = "2015-05-01")] + public partial class GetAzApplicationInsightsAnnotation_GetViaIdentityComponent : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _componentInputObject; + + /// 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 ComponentInputObject { get => this._componentInputObject; set => this._componentInputObject = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError + /// 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 System.Collections.Generic.List + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsAnnotation_GetViaIdentityComponent() + { + + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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 (ComponentInputObject?.Id != null) + { + this.ComponentInputObject.Id += $"/Annotations/{(global::System.Uri.EscapeDataString(this.Id.ToString()))}"; + await this.Client.AnnotationsGetViaIdentity(ComponentInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ComponentInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + await this.Client.AnnotationsGet(ComponentInputObject.SubscriptionId ?? null, ComponentInputObject.ResourceGroupName ?? null, ComponentInputObject.ResourceName ?? null, 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 { 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError + /// 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 System.Collections.Generic.List + /// 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 System.Collections.Generic.List + var result = (await response); + // response should be returning an array of some kind. +Pageable + // array / / + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_List.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_List.cs index 18ae17ada308..32aee136ca57 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_List.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsAnnotation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Gets the list of annotations for a component for given time range @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsAnnotation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsAnnotation_List : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -67,6 +85,9 @@ public partial class GetAzApplicationInsightsAnnotation_List : global::System.Ma [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; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class GetAzApplicationInsightsAnnotation_List : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -169,7 +190,8 @@ public partial class GetAzApplicationInsightsAnnotation_List : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -178,24 +200,24 @@ public partial class GetAzApplicationInsightsAnnotation_List : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult /// 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); + 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) @@ -218,6 +240,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -239,7 +266,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsAnnotation_List() { @@ -290,8 +317,33 @@ public GetAzApplicationInsightsAnnotation_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -344,7 +396,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -359,13 +411,13 @@ protected override void ProcessRecord() 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 this.Client.AnnotationsList(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,Start=Start,End=End}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -403,12 +455,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -425,15 +477,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, Start=Start, End=End }) + 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 } }); @@ -443,12 +495,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -460,9 +512,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_Get.cs index acc5bcf82dfe..36538fc4c96d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get the API Key for this key id. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, NewOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, ChangeDescription="The types of the properties LinkedReadProperty, LinkedWriteProperty will be changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the API Key for this key id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsApiKey_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +37,18 @@ public partial class GetAzApplicationInsightsApiKey_Get : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _apiKeyId; @@ -54,6 +68,9 @@ public partial class GetAzApplicationInsightsApiKey_Get : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -67,6 +84,9 @@ public partial class GetAzApplicationInsightsApiKey_Get : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -108,7 +128,7 @@ public partial class GetAzApplicationInsightsApiKey_Get : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -154,7 +174,8 @@ public partial class GetAzApplicationInsightsApiKey_Get : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -163,12 +184,12 @@ public partial class GetAzApplicationInsightsApiKey_Get : global::System.Managem /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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); + 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) @@ -191,6 +212,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -212,7 +238,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsApiKey_Get() { @@ -263,8 +289,33 @@ public GetAzApplicationInsightsApiKey_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -317,7 +368,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -332,13 +383,13 @@ protected override void ProcessRecord() 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 this.Client.ApiKeysGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,ApiKeyId=ApiKeyId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -374,12 +425,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,8 +442,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentity.cs index 2c283d14a749..748bc9420360 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get the API Key for this key id. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, NewOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, ChangeDescription="The types of the properties LinkedReadProperty, LinkedWriteProperty will be changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the API Key for this key id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsApiKey_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzApplicationInsightsApiKey_GetViaIdentity : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzApplicationInsightsApiKey_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +107,7 @@ public partial class GetAzApplicationInsightsApiKey_GetViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,12 +130,12 @@ public partial class GetAzApplicationInsightsApiKey_GetViaIdentity : global::Sys /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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); + 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) @@ -138,6 +158,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -159,7 +184,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsApiKey_GetViaIdentity() { @@ -210,8 +235,33 @@ public GetAzApplicationInsightsApiKey_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -264,7 +314,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -284,14 +334,14 @@ protected override void ProcessRecord() 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.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.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) ); @@ -300,13 +350,13 @@ protected override void ProcessRecord() { 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 this.Client.ApiKeysGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -342,12 +392,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -359,8 +409,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentityComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentityComponent.cs new file mode 100644 index 000000000000..0225d42b6c55 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_GetViaIdentityComponent.cs @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_GetViaIdentityComponent")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the API Key for this key id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}", ApiVersion = "2015-05-01")] + public partial class GetAzApplicationInsightsApiKey_GetViaIdentityComponent : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _componentInputObject; + + /// 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 ComponentInputObject { get => this._componentInputObject; set => this._componentInputObject = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzApplicationInsightsApiKey_GetViaIdentityComponent() + { + + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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 (ComponentInputObject?.Id != null) + { + this.ComponentInputObject.Id += $"/APIKeys/{(global::System.Uri.EscapeDataString(this.ApiKeyId.ToString()))}"; + await this.Client.ApiKeysGetViaIdentity(ComponentInputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ComponentInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + await this.Client.ApiKeysGet(ComponentInputObject.SubscriptionId ?? null, ComponentInputObject.ResourceGroupName ?? null, ComponentInputObject.ResourceName ?? null, 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 { 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + /// 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.IApplicationInsightsComponentApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_List.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_List.cs index d97a21c01573..ca39c68aedf6 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_List.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsApiKey_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Gets a list of API keys of an Application Insights component. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, NewOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, ChangeDescription="The types of the properties LinkedReadProperty, LinkedWriteProperty will be changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsApiKey_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzApplicationInsightsApiKey_List : global::System.Manage /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzApplicationInsightsApiKey_List : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +114,7 @@ public partial class GetAzApplicationInsightsApiKey_List : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -140,7 +160,8 @@ public partial class GetAzApplicationInsightsApiKey_List : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -149,12 +170,12 @@ public partial class GetAzApplicationInsightsApiKey_List : global::System.Manage /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult /// 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); + 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) @@ -177,6 +198,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -198,7 +224,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsApiKey_List() { @@ -249,8 +275,33 @@ public GetAzApplicationInsightsApiKey_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -303,7 +354,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,13 +369,13 @@ protected override void ProcessRecord() 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 this.Client.ApiKeysList(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -360,12 +411,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,9 +428,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_Get.cs index 91551300566a..5068130a7848 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Returns all available features of the application insights component. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns all available features of the application insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/getavailablebillingfeatures", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsComponentAvailableFeature_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsComponentAvailableFeature_Get : glo /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsComponentAvailableFeature_Get : glo [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +115,7 @@ public partial class GetAzApplicationInsightsComponentAvailableFeature_Get : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -140,7 +161,8 @@ public partial class GetAzApplicationInsightsComponentAvailableFeature_Get : glo [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -149,12 +171,12 @@ public partial class GetAzApplicationInsightsComponentAvailableFeature_Get : glo /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures /// 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); + 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) @@ -177,6 +199,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -198,7 +225,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsComponentAvailableFeature_Get() { @@ -249,8 +276,33 @@ public GetAzApplicationInsightsComponentAvailableFeature_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -303,7 +355,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,13 +370,13 @@ protected override void ProcessRecord() 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 this.Client.ComponentAvailableFeaturesGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -360,12 +412,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,9 +429,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / Result / - WriteObject((await response).Result, true); + if (null != result.Result) + { + if (0 == _responseSize && 1 == result.Result.Count) + { + _firstResponse = result.Result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity.cs index d3a806a06c5a..61ca795a1544 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Returns all available features of the application insights component. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns all available features of the application insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/getavailablebillingfeatures", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsComponentAvailableFeature_GetViaIde /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsComponentAvailableFeature_GetViaIde [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +108,7 @@ public partial class GetAzApplicationInsightsComponentAvailableFeature_GetViaIde /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,12 +131,12 @@ public partial class GetAzApplicationInsightsComponentAvailableFeature_GetViaIde /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures /// 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); + 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) @@ -138,6 +159,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -159,7 +185,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity() @@ -211,8 +237,33 @@ public GetAzApplicationInsightsComponentAvailableFeature_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -265,7 +316,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -285,25 +336,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentAvailableFeaturesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -339,12 +390,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -356,9 +407,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures + var result = (await response); // response should be returning an array of some kind. +Pageable // nested-array / Result / - WriteObject((await response).Result, true); + if (null != result.Result) + { + if (0 == _responseSize && 1 == result.Result.Count) + { + _firstResponse = result.Result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_Get.cs index 749bb0e3c74b..f836323facf4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Returns current billing features for an Application Insights component. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns current billing features for an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_Get /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_Get [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +115,7 @@ public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_Get /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -140,7 +161,8 @@ public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_Get [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -149,12 +171,12 @@ public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_Get /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures /// 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); + 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) @@ -177,6 +199,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -198,7 +225,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsComponentCurrentBillingFeature_Get() { @@ -249,8 +276,33 @@ public GetAzApplicationInsightsComponentCurrentBillingFeature_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -303,7 +355,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,13 +370,13 @@ protected override void ProcessRecord() 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 this.Client.ComponentCurrentBillingFeaturesGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -360,12 +412,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,8 +429,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity.cs index 89105b5858a1..7d5bfc6114c9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Returns current billing features for an Application Insights component. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns current billing features for an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_GetV /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_GetV [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +108,7 @@ public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_GetV /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,12 +131,12 @@ public partial class GetAzApplicationInsightsComponentCurrentBillingFeature_GetV /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures /// 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); + 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) @@ -138,6 +159,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -159,7 +185,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the + /// Initializes a new instance of the /// cmdlet class. /// public GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity() @@ -211,8 +237,33 @@ public GetAzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -265,7 +316,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -285,25 +336,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentCurrentBillingFeaturesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -339,12 +390,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -356,8 +407,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_Get.cs index 50bad9390e99..425f8a41ffb1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Returns feature capabilities of the application insights component. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns feature capabilities of the application insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/featurecapabilities", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsComponentFeatureCapability_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsComponentFeatureCapability_Get : gl /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsComponentFeatureCapability_Get : gl [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +115,7 @@ public partial class GetAzApplicationInsightsComponentFeatureCapability_Get : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -140,7 +161,8 @@ public partial class GetAzApplicationInsightsComponentFeatureCapability_Get : gl [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -149,12 +171,12 @@ public partial class GetAzApplicationInsightsComponentFeatureCapability_Get : gl /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities /// 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); + 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) @@ -177,6 +199,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -198,7 +225,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsComponentFeatureCapability_Get() { @@ -249,8 +276,33 @@ public GetAzApplicationInsightsComponentFeatureCapability_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -303,7 +355,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,13 +370,13 @@ protected override void ProcessRecord() 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 this.Client.ComponentFeatureCapabilitiesGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -360,12 +412,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,8 +429,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity.cs index 8abd93d4b1ec..0ea2e9ba94ce 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Returns feature capabilities of the application insights component. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns feature capabilities of the application insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/featurecapabilities", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsComponentFeatureCapability_GetViaId /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsComponentFeatureCapability_GetViaId [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +108,7 @@ public partial class GetAzApplicationInsightsComponentFeatureCapability_GetViaId /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,12 +131,12 @@ public partial class GetAzApplicationInsightsComponentFeatureCapability_GetViaId /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities /// 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); + 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) @@ -138,6 +159,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -159,7 +185,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity() @@ -211,8 +237,33 @@ public GetAzApplicationInsightsComponentFeatureCapability_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -265,7 +316,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -285,25 +336,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentFeatureCapabilitiesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -339,12 +390,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -356,8 +407,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_Get.cs index 61391679e0ec..7fb0b9a02ca1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get status for an ongoing purge operation. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get status for an ongoing purge operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/operations/{purgeId}", ApiVersion = "2020-02-02")] public partial class GetAzApplicationInsightsComponentPurgeStatus_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsComponentPurgeStatus_Get : global:: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsComponentPurgeStatus_Get : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +115,7 @@ public partial class GetAzApplicationInsightsComponentPurgeStatus_Get : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -156,7 +177,8 @@ public partial class GetAzApplicationInsightsComponentPurgeStatus_Get : global:: [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -165,24 +187,24 @@ public partial class GetAzApplicationInsightsComponentPurgeStatus_Get : global:: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse /// 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); + 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) @@ -205,6 +227,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -226,7 +253,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsComponentPurgeStatus_Get() { @@ -277,8 +304,33 @@ public GetAzApplicationInsightsComponentPurgeStatus_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -331,7 +383,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -346,13 +398,13 @@ protected override void ProcessRecord() 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 this.Client.ComponentsGetPurgeStatus(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,PurgeId=PurgeId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -390,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,15 +464,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, PurgeId=PurgeId }) + 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 } }); @@ -430,12 +482,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -447,8 +499,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse - WriteObject((await response).Status); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity.cs index 2c420d950830..7ff10f8b115e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get status for an ongoing purge operation. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get status for an ongoing purge operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/operations/{purgeId}", ApiVersion = "2020-02-02")] public partial class GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +108,7 @@ public partial class GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,24 +131,24 @@ public partial class GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse /// 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); + 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) @@ -150,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -296,14 +347,14 @@ protected override void ProcessRecord() 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.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.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) ); @@ -312,13 +363,13 @@ protected override void ProcessRecord() { 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 this.Client.ComponentsGetPurgeStatus(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -356,12 +407,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -378,7 +429,7 @@ protected override void StopProcessing() 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); + 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 } @@ -396,12 +447,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -413,8 +464,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse - WriteObject((await response).Status); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentityComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentityComponent.cs new file mode 100644 index 000000000000..54ac8eb1b18e --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentityComponent.cs @@ -0,0 +1,504 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_GetViaIdentityComponent")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get status for an ongoing purge operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/operations/{purgeId}", ApiVersion = "2020-02-02")] + public partial class GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentityComponent : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _componentInputObject; + + /// 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 ComponentInputObject { get => this._componentInputObject; set => this._componentInputObject = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the + /// cmdlet class. + /// + public GetAzApplicationInsightsComponentPurgeStatus_GetViaIdentityComponent() + { + + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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 (ComponentInputObject?.Id != null) + { + this.ComponentInputObject.Id += $"/operations/{(global::System.Uri.EscapeDataString(this.PurgeId.ToString()))}"; + await this.Client.ComponentsGetPurgeStatusViaIdentity(ComponentInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ComponentInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + await this.Client.ComponentsGetPurgeStatus(ComponentInputObject.SubscriptionId ?? null, ComponentInputObject.ResourceGroupName ?? null, ComponentInputObject.ResourceName ?? null, 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 { 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse + /// 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.IComponentPurgeStatusResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_Get.cs index c46616609981..1c68b59c2d5d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsComponentQuotaStatus_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,11 +40,26 @@ public partial class GetAzApplicationInsightsComponentQuotaStatus_Get : global:: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class GetAzApplicationInsightsComponentQuotaStatus_Get : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -96,7 +117,7 @@ public partial class GetAzApplicationInsightsComponentQuotaStatus_Get : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -142,7 +163,8 @@ public partial class GetAzApplicationInsightsComponentQuotaStatus_Get : global:: [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -151,12 +173,12 @@ public partial class GetAzApplicationInsightsComponentQuotaStatus_Get : global:: /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus /// 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); + 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) @@ -179,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -200,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsComponentQuotaStatus_Get() { @@ -251,8 +278,33 @@ public GetAzApplicationInsightsComponentQuotaStatus_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -305,7 +357,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -320,13 +372,13 @@ protected override void ProcessRecord() 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 this.Client.ComponentQuotaStatusGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +414,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity.cs index 8a3d15ba3b62..987c2f5fb9ad 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,11 +40,26 @@ public partial class GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -89,7 +110,7 @@ public partial class GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -112,12 +133,12 @@ public partial class GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus /// 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); + 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) @@ -140,6 +161,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -161,7 +187,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity() { @@ -212,8 +238,33 @@ public GetAzApplicationInsightsComponentQuotaStatus_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -266,7 +317,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -286,25 +337,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentQuotaStatusGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -340,12 +391,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -357,8 +408,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_Get.cs index 66a94b74b628..070361159da6 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get the Continuous Export configuration for this export id. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the Continuous Export configuration for this export id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsContinuousExport_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzApplicationInsightsContinuousExport_Get : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -68,6 +86,9 @@ public partial class GetAzApplicationInsightsContinuousExport_Get : global::Syst [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; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -109,7 +130,7 @@ public partial class GetAzApplicationInsightsContinuousExport_Get : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -155,7 +176,8 @@ public partial class GetAzApplicationInsightsContinuousExport_Get : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -164,12 +186,12 @@ public partial class GetAzApplicationInsightsContinuousExport_Get : global::Syst /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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); + 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) @@ -192,6 +214,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -213,7 +240,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsContinuousExport_Get() { @@ -264,8 +291,33 @@ public GetAzApplicationInsightsContinuousExport_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -318,7 +370,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -333,13 +385,13 @@ protected override void ProcessRecord() 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 this.Client.ExportConfigurationsGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,ExportId=ExportId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -375,12 +427,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -392,8 +444,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentity.cs index 4de742807538..016f2f7bdcfa 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get the Continuous Export configuration for this export id. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the Continuous Export configuration for this export id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsContinuousExport_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzApplicationInsightsContinuousExport_GetViaIdentity : g /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzApplicationInsightsContinuousExport_GetViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -86,7 +107,7 @@ public partial class GetAzApplicationInsightsContinuousExport_GetViaIdentity : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -109,12 +130,12 @@ public partial class GetAzApplicationInsightsContinuousExport_GetViaIdentity : g /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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); + 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) @@ -137,6 +158,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -158,7 +184,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsContinuousExport_GetViaIdentity() { @@ -209,8 +235,33 @@ public GetAzApplicationInsightsContinuousExport_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -263,7 +314,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -283,14 +334,14 @@ protected override void ProcessRecord() 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.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.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) ); @@ -299,13 +350,13 @@ protected override void ProcessRecord() { 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 this.Client.ExportConfigurationsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -341,12 +392,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -358,8 +409,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentityComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentityComponent.cs new file mode 100644 index 000000000000..37654f76bac2 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_GetViaIdentityComponent.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_GetViaIdentityComponent")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the Continuous Export configuration for this export id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] + public partial class GetAzApplicationInsightsContinuousExport_GetViaIdentityComponent : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _componentInputObject; + + /// 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 ComponentInputObject { get => this._componentInputObject; set => this._componentInputObject = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.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; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public GetAzApplicationInsightsContinuousExport_GetViaIdentityComponent() + { + + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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 (ComponentInputObject?.Id != null) + { + this.ComponentInputObject.Id += $"/exportconfiguration/{(global::System.Uri.EscapeDataString(this.ExportId.ToString()))}"; + await this.Client.ExportConfigurationsGetViaIdentity(ComponentInputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ComponentInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + await this.Client.ExportConfigurationsGet(ComponentInputObject.SubscriptionId ?? null, ComponentInputObject.ResourceGroupName ?? null, ComponentInputObject.ResourceName ?? null, 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 { 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + /// 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.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_List.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_List.cs index a8e8e5679214..79afc7947132 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_List.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsContinuousExport_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration", ApiVersion = "2015-05-01")] public partial class GetAzApplicationInsightsContinuousExport_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +39,26 @@ public partial class GetAzApplicationInsightsContinuousExport_List : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -54,6 +72,9 @@ public partial class GetAzApplicationInsightsContinuousExport_List : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -95,7 +116,7 @@ public partial class GetAzApplicationInsightsContinuousExport_List : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -141,7 +162,8 @@ public partial class GetAzApplicationInsightsContinuousExport_List : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -150,12 +172,12 @@ public partial class GetAzApplicationInsightsContinuousExport_List : global::Sys /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -178,6 +200,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -199,7 +226,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsContinuousExport_List() { @@ -250,8 +277,33 @@ public GetAzApplicationInsightsContinuousExport_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -304,7 +356,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,13 +371,13 @@ protected override void ProcessRecord() 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 this.Client.ExportConfigurationsList(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -361,12 +413,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -378,9 +430,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_Get.cs index 8796e58aaa26..b8aa40f777af 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] public partial class GetAzApplicationInsightsLinkedStorageAccount_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +39,26 @@ public partial class GetAzApplicationInsightsLinkedStorageAccount_Get : global:: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -54,6 +72,9 @@ public partial class GetAzApplicationInsightsLinkedStorageAccount_Get : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -95,7 +116,7 @@ public partial class GetAzApplicationInsightsLinkedStorageAccount_Get : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -141,7 +162,8 @@ public partial class GetAzApplicationInsightsLinkedStorageAccount_Get : global:: [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -150,24 +172,24 @@ public partial class GetAzApplicationInsightsLinkedStorageAccount_Get : global:: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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); + 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) @@ -190,6 +212,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -211,7 +238,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsLinkedStorageAccount_Get() { @@ -262,8 +289,33 @@ public GetAzApplicationInsightsLinkedStorageAccount_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -316,7 +368,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -331,13 +383,13 @@ protected override void ProcessRecord() 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 this.Client.ComponentLinkedStorageAccountsGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -375,12 +427,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -397,15 +449,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + 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 } }); @@ -415,12 +467,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -432,8 +484,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity.cs index d50b0a16f5be..ba657dccc45b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] public partial class GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +39,26 @@ public partial class GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -54,6 +72,9 @@ public partial class GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -88,7 +109,7 @@ public partial class GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -111,24 +132,24 @@ public partial class GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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); + 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) @@ -151,6 +172,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -172,7 +198,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity() { @@ -223,8 +249,33 @@ public GetAzApplicationInsightsLinkedStorageAccount_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -277,7 +328,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -297,25 +348,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentLinkedStorageAccountsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -353,12 +404,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -375,7 +426,7 @@ protected override void StopProcessing() 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); + 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 } @@ -393,12 +444,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,8 +461,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_Get.cs index 9ea9d07bc432..a9b690817f2e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get a single private workbook by its resourceName. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsMyWorkbook_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The types of the properties PropertiesTag will be changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a single private workbook by its resourceName.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}", ApiVersion = "2021-03-08")] public partial class GetAzApplicationInsightsMyWorkbook_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzApplicationInsightsMyWorkbook_Get : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzApplicationInsightsMyWorkbook_Get : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +113,7 @@ public partial class GetAzApplicationInsightsMyWorkbook_Get : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -139,7 +159,8 @@ public partial class GetAzApplicationInsightsMyWorkbook_Get : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -148,24 +169,24 @@ public partial class GetAzApplicationInsightsMyWorkbook_Get : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// 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); + 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) @@ -188,6 +209,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +235,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsMyWorkbook_Get() { @@ -260,8 +286,33 @@ public GetAzApplicationInsightsMyWorkbook_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -314,7 +365,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +386,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -373,12 +424,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -395,15 +446,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 } }); @@ -413,12 +464,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -430,8 +481,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_List.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_List.cs index dbb6285099ef..4d6ddb52c4ba 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_List.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -15,13 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsMyWorkbook_List")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The types of the properties PropertiesTag will be changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get all private workbooks defined within a specified resource group and category.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks", ApiVersion = "2021-03-08")] public partial class GetAzApplicationInsightsMyWorkbook_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,12 +39,24 @@ public partial class GetAzApplicationInsightsMyWorkbook_List : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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)] @@ -65,8 +79,11 @@ public partial class GetAzApplicationInsightsMyWorkbook_List : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] public global::System.Management.Automation.SwitchParameter CanFetchContent { get => this._canFetchContent; set => this._canFetchContent = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType _category; + private string _category; /// Category of workbook to return. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Category of workbook to return.")] @@ -75,10 +92,10 @@ public partial class GetAzApplicationInsightsMyWorkbook_List : global::System.Ma ReadOnly = false, Description = @"Category of workbook to return.", SerializedName = @"category", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType Category { get => this._category; set => this._category = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("workbook", "TSG", "performance", "retention")] + public string Category { get => this._category; set => this._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; @@ -93,6 +110,9 @@ public partial class GetAzApplicationInsightsMyWorkbook_List : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -133,7 +153,7 @@ public partial class GetAzApplicationInsightsMyWorkbook_List : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -179,12 +199,13 @@ public partial class GetAzApplicationInsightsMyWorkbook_List : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } /// Backing field for property. - private string[] _tag; + private System.Collections.Generic.List _tag; /// Tags presents on each workbook returned. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags presents on each workbook returned.")] @@ -196,31 +217,31 @@ public partial class GetAzApplicationInsightsMyWorkbook_List : global::System.Ma SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] - public string[] Tag { get => this._tag; set => this._tag = value; } + public System.Collections.Generic.List Tag { get => this._tag; set => this._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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult /// 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); + 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) @@ -243,6 +264,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -264,7 +290,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsMyWorkbook_List() { @@ -315,8 +341,33 @@ public GetAzApplicationInsightsMyWorkbook_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -369,7 +420,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -390,7 +441,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Category=Category,Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Category=Category,Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -428,12 +479,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -450,15 +501,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Category=Category, Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Category=Category, Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 } }); @@ -468,12 +519,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -485,15 +536,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_List1.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_List1.cs index 9a4c85aa55ba..2986668abd72 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_List1.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsMyWorkbook_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get all private workbooks defined within a specified subscription and category. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/microsoft.insights/myWorkbooks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsMyWorkbook_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The types of the properties PropertiesTag will be changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get all private workbooks defined within a specified subscription and category.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/microsoft.insights/myWorkbooks", ApiVersion = "2021-03-08")] public partial class GetAzApplicationInsightsMyWorkbook_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,12 +37,24 @@ public partial class GetAzApplicationInsightsMyWorkbook_List1 : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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)] @@ -63,8 +77,11 @@ public partial class GetAzApplicationInsightsMyWorkbook_List1 : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] public global::System.Management.Automation.SwitchParameter CanFetchContent { get => this._canFetchContent; set => this._canFetchContent = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType _category; + private string _category; /// Category of workbook to return. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Category of workbook to return.")] @@ -73,10 +90,10 @@ public partial class GetAzApplicationInsightsMyWorkbook_List1 : global::System.M ReadOnly = false, Description = @"Category of workbook to return.", SerializedName = @"category", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType Category { get => this._category; set => this._category = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("workbook", "TSG", "performance", "retention")] + public string Category { get => this._category; set => this._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; @@ -91,6 +108,9 @@ public partial class GetAzApplicationInsightsMyWorkbook_List1 : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -117,7 +137,7 @@ public partial class GetAzApplicationInsightsMyWorkbook_List1 : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -149,12 +169,13 @@ public partial class GetAzApplicationInsightsMyWorkbook_List1 : global::System.M [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } /// Backing field for property. - private string[] _tag; + private System.Collections.Generic.List _tag; /// Tags presents on each workbook returned. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags presents on each workbook returned.")] @@ -166,31 +187,31 @@ public partial class GetAzApplicationInsightsMyWorkbook_List1 : global::System.M SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] - public string[] Tag { get => this._tag; set => this._tag = value; } + public System.Collections.Generic.List Tag { get => this._tag; set => this._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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult /// 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); + 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) @@ -213,6 +234,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -234,7 +260,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsMyWorkbook_List1() { @@ -285,8 +311,33 @@ public GetAzApplicationInsightsMyWorkbook_List1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -339,7 +390,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -360,7 +411,7 @@ protected override void ProcessRecord() } 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,Category=Category,Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Category=Category,Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -398,12 +449,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -420,15 +471,15 @@ protected override void StopProcessing() 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, Category=Category, Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 { SubscriptionId=SubscriptionId, Category=Category, Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 } }); @@ -438,12 +489,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -455,15 +506,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List.cs index 6ca27ce9f67b..f86026906bd8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Lists all of the available insights REST API operations. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Lists all of the available insights REST API operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/providers/microsoft.insights/operations", ApiVersion = "2021-03-08")] public partial class GetAzApplicationInsightsOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzApplicationInsightsOperation_List : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzApplicationInsightsOperation_List : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -85,7 +106,7 @@ public partial class GetAzApplicationInsightsOperation_List : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -108,24 +129,24 @@ public partial class GetAzApplicationInsightsOperation_List : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult /// 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); + 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) @@ -148,6 +169,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -169,7 +195,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsOperation_List() { @@ -220,8 +246,33 @@ public GetAzApplicationInsightsOperation_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -274,7 +325,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -292,7 +343,7 @@ protected override void ProcessRecord() } 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 { }) + 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 } }); @@ -330,12 +381,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -352,7 +403,7 @@ protected override void StopProcessing() 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); + 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 } @@ -370,12 +421,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +438,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_Get.cs index 6a73aa126beb..763b36d35bb1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get a specific Application Insights web test definition. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWebTest_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, NewOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, ChangeDescription="The type of property 'RequestHeader' will be changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField]'. And the property 'PropertiesLocations' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest' will be removed.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a specific Application Insights web test definition.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] public partial class GetAzApplicationInsightsWebTest_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzApplicationInsightsWebTest_Get : global::System.Manage /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzApplicationInsightsWebTest_Get : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +114,7 @@ public partial class GetAzApplicationInsightsWebTest_Get : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -140,7 +160,8 @@ public partial class GetAzApplicationInsightsWebTest_Get : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -149,12 +170,12 @@ public partial class GetAzApplicationInsightsWebTest_Get : global::System.Manage /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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); + 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) @@ -177,6 +198,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -198,7 +224,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWebTest_Get() { @@ -249,8 +275,33 @@ public GetAzApplicationInsightsWebTest_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -303,7 +354,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,13 +369,13 @@ protected override void ProcessRecord() 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.WebTestsGet(ResourceGroupName, SubscriptionId, Name, onOk, this, Pipeline); + await this.Client.WebTestsGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -360,12 +411,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,8 +428,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_GetViaIdentity.cs index 5d21397a192b..27454f31c70a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get a specific Application Insights web test definition. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWebTest_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, NewOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, ChangeDescription="The type of property 'RequestHeader' will be changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField]'. And the property 'PropertiesLocations' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest' will be removed.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a specific Application Insights web test definition.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] public partial class GetAzApplicationInsightsWebTest_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzApplicationInsightsWebTest_GetViaIdentity : global::Sy /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzApplicationInsightsWebTest_GetViaIdentity : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +107,7 @@ public partial class GetAzApplicationInsightsWebTest_GetViaIdentity : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,12 +130,12 @@ public partial class GetAzApplicationInsightsWebTest_GetViaIdentity : global::Sy /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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); + 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) @@ -138,6 +158,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -159,7 +184,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWebTest_GetViaIdentity() { @@ -210,8 +235,33 @@ public GetAzApplicationInsightsWebTest_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -264,7 +314,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -284,25 +334,25 @@ protected override void ProcessRecord() 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.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.WebTestName) { 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.WebTestsGet(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.WebTestName ?? null, onOk, this, Pipeline); + await this.Client.WebTestsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WebTestName ?? 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 { }) + 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 } }); @@ -338,12 +388,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -355,8 +405,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List.cs index 5b069855e7ea..9c44960517fc 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -15,13 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWebTest_List")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, NewOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, ChangeDescription="The type of property 'RequestHeader' will be changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField]'. And the property 'PropertiesLocations' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest' will be removed.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get all Application Insights web tests defined for the specified resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests", ApiVersion = "2022-06-15")] public partial class GetAzApplicationInsightsWebTest_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +39,32 @@ public partial class GetAzApplicationInsightsWebTest_List : global::System.Manag /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -61,6 +78,9 @@ public partial class GetAzApplicationInsightsWebTest_List : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +107,7 @@ public partial class GetAzApplicationInsightsWebTest_List : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -133,7 +153,8 @@ public partial class GetAzApplicationInsightsWebTest_List : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -142,12 +163,12 @@ public partial class GetAzApplicationInsightsWebTest_List : global::System.Manag /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult /// 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); + 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) @@ -170,6 +191,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWebTest_List() { @@ -242,8 +268,33 @@ public GetAzApplicationInsightsWebTest_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -311,13 +362,13 @@ protected override void ProcessRecord() 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.WebTestsListByResourceGroup(ResourceGroupName, SubscriptionId, onOk, this, Pipeline); + await this.Client.WebTestsListByResourceGroup(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,12 +404,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -370,15 +421,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List1.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List1.cs index c75402549a46..349c04a38602 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List1.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// @@ -15,13 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/microsoft.insights/webtests" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWebTest_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, NewOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, ChangeDescription="The type of property 'RequestHeader' will be changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField]'. And the property 'PropertiesLocations' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest' will be removed.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get all Application Insights web test definitions for the specified subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/microsoft.insights/webtests", ApiVersion = "2022-06-15")] public partial class GetAzApplicationInsightsWebTest_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +39,32 @@ public partial class GetAzApplicationInsightsWebTest_List1 : global::System.Mana /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -61,6 +78,9 @@ public partial class GetAzApplicationInsightsWebTest_List1 : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +107,7 @@ public partial class GetAzApplicationInsightsWebTest_List1 : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -119,7 +139,8 @@ public partial class GetAzApplicationInsightsWebTest_List1 : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -128,12 +149,12 @@ public partial class GetAzApplicationInsightsWebTest_List1 : global::System.Mana /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult /// 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); + 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) @@ -156,6 +177,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -177,7 +203,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWebTest_List1() { @@ -228,8 +254,33 @@ public GetAzApplicationInsightsWebTest_List1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -282,7 +333,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -303,7 +354,7 @@ protected override void ProcessRecord() } 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}) + 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 } }); @@ -339,12 +390,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -356,15 +407,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List2.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List2.cs index 931d3aa9088e..6e5a7833ac59 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List2.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWebTest_List2.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get all Application Insights web tests defined for the specified component. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] ListByComponent=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{componentName}/webtests" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWebTest_List2")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, NewOutputProperties=new string[] {"RequestHeader","PropertiesLocations"}, ChangeDescription="The type of property 'RequestHeader' will be changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField]'. And the property 'PropertiesLocations' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest' will be removed.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get all Application Insights web tests defined for the specified component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{componentName}/webtests", ApiVersion = "2022-06-15")] public partial class GetAzApplicationInsightsWebTest_List2 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,12 +37,24 @@ public partial class GetAzApplicationInsightsWebTest_List2 : global::System.Mana /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _appInsightsName; @@ -60,6 +74,9 @@ public partial class GetAzApplicationInsightsWebTest_List2 : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -73,6 +90,9 @@ public partial class GetAzApplicationInsightsWebTest_List2 : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -99,7 +119,7 @@ public partial class GetAzApplicationInsightsWebTest_List2 : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -145,7 +165,8 @@ public partial class GetAzApplicationInsightsWebTest_List2 : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -154,12 +175,12 @@ public partial class GetAzApplicationInsightsWebTest_List2 : global::System.Mana /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult /// 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); + 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) @@ -182,6 +203,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -203,7 +229,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWebTest_List2() { @@ -254,8 +280,33 @@ public GetAzApplicationInsightsWebTest_List2() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -308,7 +359,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,13 +374,13 @@ protected override void ProcessRecord() 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.WebTestsListByComponent(AppInsightsName, ResourceGroupName, SubscriptionId, onOk, this, Pipeline); + await this.Client.WebTestsListByComponent(SubscriptionId, ResourceGroupName, AppInsightsName, 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 { AppInsightsName=AppInsightsName,ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AppInsightsName=AppInsightsName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -365,12 +416,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -382,15 +433,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_Get.cs index 5dcfed05b125..2044b92aab62 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get a single workbook revision defined by its revisionId. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] RevisionGet=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions/{revisionId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbookRevision_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a single workbook revision defined by its revisionId.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions/{revisionId}", ApiVersion = "2022-04-01")] public partial class GetAzApplicationInsightsWorkbookRevision_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzApplicationInsightsWorkbookRevision_Get : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzApplicationInsightsWorkbookRevision_Get : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +113,7 @@ public partial class GetAzApplicationInsightsWorkbookRevision_Get : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -153,7 +173,8 @@ public partial class GetAzApplicationInsightsWorkbookRevision_Get : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -162,24 +183,24 @@ public partial class GetAzApplicationInsightsWorkbookRevision_Get : global::Syst /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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); + 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) @@ -202,6 +223,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -223,7 +249,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWorkbookRevision_Get() { @@ -274,8 +300,33 @@ public GetAzApplicationInsightsWorkbookRevision_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -328,7 +379,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -349,7 +400,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Name=Name,RevisionId=RevisionId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,RevisionId=RevisionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,12 +438,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,15 +460,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name, RevisionId=RevisionId }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, RevisionId=RevisionId }) + 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 } }); @@ -427,12 +478,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -444,8 +495,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_GetViaIdentity.cs index 40e9f3dc5472..aaa078b37f56 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get a single workbook revision defined by its revisionId. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] RevisionGet=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions/{revisionId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbookRevision_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a single workbook revision defined by its revisionId.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions/{revisionId}", ApiVersion = "2022-04-01")] public partial class GetAzApplicationInsightsWorkbookRevision_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzApplicationInsightsWorkbookRevision_GetViaIdentity : g /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzApplicationInsightsWorkbookRevision_GetViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +107,7 @@ public partial class GetAzApplicationInsightsWorkbookRevision_GetViaIdentity : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,24 +130,24 @@ public partial class GetAzApplicationInsightsWorkbookRevision_GetViaIdentity : g /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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); + 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) @@ -150,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWorkbookRevision_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzApplicationInsightsWorkbookRevision_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +368,7 @@ protected override void ProcessRecord() } 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 { }) + 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 } }); @@ -356,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -378,7 +428,7 @@ protected override void StopProcessing() 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); + 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 } @@ -396,12 +446,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -413,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_GetViaIdentityWorkbook.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_GetViaIdentityWorkbook.cs new file mode 100644 index 000000000000..51f43557e1c4 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_GetViaIdentityWorkbook.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// Get a single workbook revision defined by its revisionId. + /// + /// [OpenAPI] RevisionGet=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions/{revisionId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbookRevision_GetViaIdentityWorkbook")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a single workbook revision defined by its revisionId.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions/{revisionId}", ApiVersion = "2022-04-01")] + public partial class GetAzApplicationInsightsWorkbookRevision_GetViaIdentityWorkbook : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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 _revisionId; + + /// The id of the workbook's revision. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The id of the workbook's revision.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The id of the workbook's revision.", + SerializedName = @"revisionId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Path)] + public string RevisionId { get => this._revisionId; set => this._revisionId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _workbookInputObject; + + /// 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 WorkbookInputObject { get => this._workbookInputObject; set => this._workbookInputObject = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public GetAzApplicationInsightsWorkbookRevision_GetViaIdentityWorkbook() + { + + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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 (WorkbookInputObject?.Id != null) + { + this.WorkbookInputObject.Id += $"/revisions/{(global::System.Uri.EscapeDataString(this.RevisionId.ToString()))}"; + await this.Client.WorkbooksRevisionGetViaIdentity(WorkbookInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == WorkbookInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkbookInputObject has null value for WorkbookInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkbookInputObject) ); + } + if (null == WorkbookInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkbookInputObject has null value for WorkbookInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkbookInputObject) ); + } + if (null == WorkbookInputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("WorkbookInputObject has null value for WorkbookInputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, WorkbookInputObject) ); + } + await this.Client.WorkbooksRevisionGet(WorkbookInputObject.SubscriptionId ?? null, WorkbookInputObject.ResourceGroupName ?? null, WorkbookInputObject.ResourceName ?? null, RevisionId, 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 { RevisionId=RevisionId}) + { + 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_List.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_List.cs index 4a8a748e0381..a555489df522 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_List.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookRevision_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get the revisions for the workbook defined by its resourceName. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] RevisionsList=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbookRevision_List")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get the revisions for the workbook defined by its resourceName.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}/revisions", ApiVersion = "2022-04-01")] public partial class GetAzApplicationInsightsWorkbookRevision_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzApplicationInsightsWorkbookRevision_List : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzApplicationInsightsWorkbookRevision_List : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -99,7 +119,7 @@ public partial class GetAzApplicationInsightsWorkbookRevision_List : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -145,7 +165,8 @@ public partial class GetAzApplicationInsightsWorkbookRevision_List : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -154,24 +175,24 @@ public partial class GetAzApplicationInsightsWorkbookRevision_List : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult /// 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); + 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) @@ -194,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -215,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWorkbookRevision_List() { @@ -266,8 +292,33 @@ public GetAzApplicationInsightsWorkbookRevision_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -320,7 +371,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,7 +392,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -379,12 +430,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -401,15 +452,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 } }); @@ -419,12 +470,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -436,15 +487,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookTemplate_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookTemplate_Get.cs index 053ba9a5dab7..56d2434b7f6c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookTemplate_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookTemplate_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get a single workbook template by its resourceName. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbookTemplate_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Gallery"}, NewOutputProperties=new string[] {"Gallery"}, ChangeDescription="The type of property 'Gallery' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a single workbook template by its resourceName.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] public partial class GetAzApplicationInsightsWorkbookTemplate_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzApplicationInsightsWorkbookTemplate_Get : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzApplicationInsightsWorkbookTemplate_Get : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +113,7 @@ public partial class GetAzApplicationInsightsWorkbookTemplate_Get : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -139,7 +159,8 @@ public partial class GetAzApplicationInsightsWorkbookTemplate_Get : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -148,24 +169,24 @@ public partial class GetAzApplicationInsightsWorkbookTemplate_Get : global::Syst /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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); + 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) @@ -188,6 +209,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +235,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWorkbookTemplate_Get() { @@ -260,8 +286,33 @@ public GetAzApplicationInsightsWorkbookTemplate_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -314,7 +365,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +386,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -373,12 +424,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -395,15 +446,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 } }); @@ -413,12 +464,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -430,8 +481,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity.cs index 6a0887539fdc..f2994f0182df 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get a single workbook template by its resourceName. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbookTemplate_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Gallery"}, NewOutputProperties=new string[] {"Gallery"}, ChangeDescription="The type of property 'Gallery' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a single workbook template by its resourceName.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] public partial class GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity : g /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +107,7 @@ public partial class GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,24 +130,24 @@ public partial class GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity : g /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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); + 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) @@ -150,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzApplicationInsightsWorkbookTemplate_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } 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 { }) + 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 } }); @@ -352,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,7 +424,7 @@ protected override void StopProcessing() 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); + 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 } @@ -392,12 +442,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_Get.cs index 2ea84d8581ad..ab1c989cc9c3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get a single workbook by its resourceName. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbook_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a single workbook by its resourceName.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] public partial class GetAzApplicationInsightsWorkbook_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +37,18 @@ public partial class GetAzApplicationInsightsWorkbook_Get : global::System.Manag /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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)] @@ -57,6 +71,9 @@ public partial class GetAzApplicationInsightsWorkbook_Get : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] public global::System.Management.Automation.SwitchParameter CanFetchContent { get => this._canFetchContent; set => this._canFetchContent = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -70,6 +87,9 @@ public partial class GetAzApplicationInsightsWorkbook_Get : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -110,7 +130,7 @@ public partial class GetAzApplicationInsightsWorkbook_Get : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -156,7 +176,8 @@ public partial class GetAzApplicationInsightsWorkbook_Get : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -165,24 +186,24 @@ public partial class GetAzApplicationInsightsWorkbook_Get : global::System.Manag /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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); + 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) @@ -205,6 +226,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -226,7 +252,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWorkbook_Get() { @@ -277,8 +303,33 @@ public GetAzApplicationInsightsWorkbook_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -331,7 +382,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -352,7 +403,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Name=Name,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -390,12 +441,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,15 +463,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 } }); @@ -430,12 +481,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -447,8 +498,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_GetViaIdentity.cs index a3fc89b59c0b..08bb681711d5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get a single workbook by its resourceName. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbook_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get a single workbook by its resourceName.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] public partial class GetAzApplicationInsightsWorkbook_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +37,18 @@ public partial class GetAzApplicationInsightsWorkbook_GetViaIdentity : global::S /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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)] @@ -57,6 +71,9 @@ public partial class GetAzApplicationInsightsWorkbook_GetViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] public global::System.Management.Automation.SwitchParameter CanFetchContent { get => this._canFetchContent; set => this._canFetchContent = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -70,6 +87,9 @@ public partial class GetAzApplicationInsightsWorkbook_GetViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -104,7 +124,7 @@ public partial class GetAzApplicationInsightsWorkbook_GetViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -127,24 +147,24 @@ public partial class GetAzApplicationInsightsWorkbook_GetViaIdentity : global::S /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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); + 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) @@ -167,6 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -188,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWorkbook_GetViaIdentity() { @@ -239,8 +264,33 @@ public GetAzApplicationInsightsWorkbook_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -293,7 +343,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -331,7 +381,7 @@ protected override void ProcessRecord() } 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 { CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -369,12 +419,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,15 +441,15 @@ protected override void StopProcessing() 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 { CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 { CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 } }); @@ -409,12 +459,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -426,8 +476,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_List.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_List.cs index 406a05cad53d..91d99c241ad1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_List.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get all Workbooks defined within a specified subscription and category. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/microsoft.insights/workbooks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbook_List")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get all Workbooks defined within a specified subscription and category.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/microsoft.insights/workbooks", ApiVersion = "2022-04-01")] public partial class GetAzApplicationInsightsWorkbook_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,12 +37,24 @@ public partial class GetAzApplicationInsightsWorkbook_List : global::System.Mana /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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)] @@ -63,8 +77,11 @@ public partial class GetAzApplicationInsightsWorkbook_List : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] public global::System.Management.Automation.SwitchParameter CanFetchContent { get => this._canFetchContent; set => this._canFetchContent = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType _category; + private string _category; /// Category of workbook to return. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Category of workbook to return.")] @@ -73,10 +90,10 @@ public partial class GetAzApplicationInsightsWorkbook_List : global::System.Mana ReadOnly = false, Description = @"Category of workbook to return.", SerializedName = @"category", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType Category { get => this._category; set => this._category = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("workbook", "TSG", "performance", "retention")] + public string Category { get => this._category; set => this._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; @@ -91,6 +108,9 @@ public partial class GetAzApplicationInsightsWorkbook_List : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -117,7 +137,7 @@ public partial class GetAzApplicationInsightsWorkbook_List : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -149,12 +169,13 @@ public partial class GetAzApplicationInsightsWorkbook_List : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } /// Backing field for property. - private string[] _tag; + private System.Collections.Generic.List _tag; /// Tags presents on each workbook returned. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags presents on each workbook returned.")] @@ -166,31 +187,31 @@ public partial class GetAzApplicationInsightsWorkbook_List : global::System.Mana SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] - public string[] Tag { get => this._tag; set => this._tag = value; } + public System.Collections.Generic.List Tag { get => this._tag; set => this._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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult /// 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); + 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) @@ -213,6 +234,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -234,7 +260,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWorkbook_List() { @@ -285,8 +311,33 @@ public GetAzApplicationInsightsWorkbook_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -339,7 +390,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -360,7 +411,7 @@ protected override void ProcessRecord() } 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,Category=Category,Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Category=Category,Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -398,12 +449,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -420,15 +471,15 @@ protected override void StopProcessing() 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, Category=Category, Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 { SubscriptionId=SubscriptionId, Category=Category, Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 } }); @@ -438,12 +489,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -455,15 +506,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_List1.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_List1.cs index 689150d6e2a5..b8ce59810199 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_List1.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsightsWorkbook_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Get all Workbooks defined within a specified resource group and category. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzApplicationInsightsWorkbook_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Get all Workbooks defined within a specified resource group and category.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks", ApiVersion = "2022-04-01")] public partial class GetAzApplicationInsightsWorkbook_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,12 +37,24 @@ public partial class GetAzApplicationInsightsWorkbook_List1 : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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)] @@ -63,8 +77,11 @@ public partial class GetAzApplicationInsightsWorkbook_List1 : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] public global::System.Management.Automation.SwitchParameter CanFetchContent { get => this._canFetchContent; set => this._canFetchContent = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType _category; + private string _category; /// Category of workbook to return. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Category of workbook to return.")] @@ -73,10 +90,10 @@ public partial class GetAzApplicationInsightsWorkbook_List1 : global::System.Man ReadOnly = false, Description = @"Category of workbook to return.", SerializedName = @"category", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType) })] + PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CategoryType Category { get => this._category; set => this._category = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("workbook", "TSG", "performance", "retention")] + public string Category { get => this._category; set => this._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; @@ -91,6 +108,9 @@ public partial class GetAzApplicationInsightsWorkbook_List1 : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -131,7 +151,7 @@ public partial class GetAzApplicationInsightsWorkbook_List1 : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -177,12 +197,13 @@ public partial class GetAzApplicationInsightsWorkbook_List1 : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } /// Backing field for property. - private string[] _tag; + private System.Collections.Generic.List _tag; /// Tags presents on each workbook returned. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags presents on each workbook returned.")] @@ -194,31 +215,31 @@ public partial class GetAzApplicationInsightsWorkbook_List1 : global::System.Man SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] - public string[] Tag { get => this._tag; set => this._tag = value; } + public System.Collections.Generic.List Tag { get => this._tag; set => this._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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult /// 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); + 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) @@ -241,6 +262,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -262,7 +288,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsightsWorkbook_List1() { @@ -313,8 +339,33 @@ public GetAzApplicationInsightsWorkbook_List1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -367,7 +418,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -388,7 +439,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Category=Category,Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Category=Category,Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null,CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?)}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -426,12 +477,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -448,15 +499,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Category=Category, Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Category=Category, Tag=this.InvocationInformation.BoundParameters.ContainsKey("Tag") ? Tag : null /* arrayOf */, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, CanFetchContent=this.InvocationInformation.BoundParameters.ContainsKey("CanFetchContent") ? CanFetchContent : default(global::System.Management.Automation.SwitchParameter?) }) + 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 } }); @@ -466,12 +517,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbooksListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -483,15 +534,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_Get.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_Get.cs index ed53a09154cc..49e9409fe253 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_Get.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Returns an Application Insights component. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class GetAzApplicationInsights_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsights_Get : global::System.Management.Au /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsights_Get : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +115,7 @@ public partial class GetAzApplicationInsights_Get : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -140,7 +161,8 @@ public partial class GetAzApplicationInsights_Get : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -149,24 +171,24 @@ public partial class GetAzApplicationInsights_Get : global::System.Management.Au /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -189,6 +211,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -210,7 +237,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsights_Get() { @@ -261,8 +288,33 @@ public GetAzApplicationInsights_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -315,7 +367,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,13 +382,13 @@ protected override void ProcessRecord() 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 this.Client.ComponentsGet(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -374,12 +426,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -396,15 +448,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + 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 } }); @@ -414,12 +466,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -431,8 +483,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_GetViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_GetViaIdentity.cs index 55da7f798c5a..0a57ab37b66a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_GetViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Returns an Application Insights component. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Returns an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class GetAzApplicationInsights_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzApplicationInsights_GetViaIdentity : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzApplicationInsights_GetViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +108,7 @@ public partial class GetAzApplicationInsights_GetViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,24 +131,24 @@ public partial class GetAzApplicationInsights_GetViaIdentity : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -150,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsights_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzApplicationInsights_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -296,25 +347,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -352,12 +403,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,7 +425,7 @@ protected override void StopProcessing() 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); + 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 } @@ -392,12 +443,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List.cs index 7ca6dec22d12..bf1c6ae55914 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Gets a list of all Application Insights components within a subscription. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/microsoft.insights/components", ApiVersion = "2020-02-02")] public partial class GetAzApplicationInsights_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzApplicationInsights_List : global::System.Management.A /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzApplicationInsights_List : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -85,7 +106,7 @@ public partial class GetAzApplicationInsights_List : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -117,7 +138,8 @@ public partial class GetAzApplicationInsights_List : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -126,24 +148,24 @@ public partial class GetAzApplicationInsights_List : global::System.Management.A /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult /// 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); + 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) @@ -166,6 +188,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +214,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsights_List() { @@ -238,8 +265,33 @@ public GetAzApplicationInsights_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -292,7 +344,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +365,7 @@ protected override void ProcessRecord() } 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}) + 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 } }); @@ -351,12 +403,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -373,15 +425,15 @@ protected override void StopProcessing() 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 }) + 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 { SubscriptionId=SubscriptionId }) + 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 } }); @@ -391,12 +443,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,15 +460,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List1.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List1.cs index bbff6fa0b582..e6731defddad 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List1.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/GetAzApplicationInsights_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Gets a list of Application Insights components within a resource group. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components", ApiVersion = "2020-02-02")] public partial class GetAzApplicationInsights_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzApplicationInsights_List1 : global::System.Management. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzApplicationInsights_List1 : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -85,7 +106,7 @@ public partial class GetAzApplicationInsights_List1 : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -131,7 +152,8 @@ public partial class GetAzApplicationInsights_List1 : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -140,24 +162,24 @@ public partial class GetAzApplicationInsights_List1 : global::System.Management. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult /// 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); + 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) @@ -180,6 +202,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +228,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzApplicationInsights_List1() { @@ -252,8 +279,33 @@ public GetAzApplicationInsights_List1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -306,7 +358,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,13 +373,13 @@ protected override void ProcessRecord() 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 this.Client.ComponentsListByResourceGroup(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -365,12 +417,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +439,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) + 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 } }); @@ -405,12 +457,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -422,15 +474,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_Create.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_Create.cs index 07146e937d3d..d3c2f51218c7 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_Create.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_Create.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create an Annotation of an Application Insights component. + /// 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_Create", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an Annotation of an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations", ApiVersion = "2015-05-01")] public partial class NewAzApplicationInsightsAnnotation_Create : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class NewAzApplicationInsightsAnnotation_Create : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation _annotationProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation _annotationProperty; /// Annotation associated with an application insights resource. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Annotation associated with an application insights resource.", ValueFromPipeline = true)] @@ -45,14 +60,18 @@ public partial class NewAzApplicationInsightsAnnotation_Create : global::System. ReadOnly = false, Description = @"Annotation associated with an application insights resource.", SerializedName = @"annotationProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation AnnotationProperty { get => this._annotationProperty; set => this._annotationProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation AnnotationProperty { get => this._annotationProperty; set => this._annotationProperty = 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -66,6 +85,9 @@ public partial class NewAzApplicationInsightsAnnotation_Create : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -92,7 +114,7 @@ public partial class NewAzApplicationInsightsAnnotation_Create : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -152,7 +174,8 @@ public partial class NewAzApplicationInsightsAnnotation_Create : global::System. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -161,24 +184,24 @@ public partial class NewAzApplicationInsightsAnnotation_Create : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -201,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -265,8 +293,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -276,7 +329,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsAnnotation_Create() { @@ -330,7 +383,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -343,12 +396,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.AnnotationsCreate(ResourceGroupName, SubscriptionId, ResourceName, AnnotationProperty, onOk, onDefault, this, Pipeline); + await this.Client.AnnotationsCreate(SubscriptionId, ResourceGroupName, ResourceName, AnnotationProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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=AnnotationProperty}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -386,12 +439,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,15 +461,15 @@ protected override void StopProcessing() 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=AnnotationProperty }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, body=AnnotationProperty }) + 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 } }); @@ -426,12 +479,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -443,9 +496,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateExpanded.cs index 62ca1eb93a42..328937fb580f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create an Annotation of an Application Insights component. + /// 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an Annotation of an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations", ApiVersion = "2015-05-01")] public partial class NewAzApplicationInsightsAnnotation_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,13 +34,25 @@ public partial class NewAzApplicationInsightsAnnotation_CreateExpanded : global: 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation _annotationPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Annotation(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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)] @@ -54,6 +69,9 @@ public partial class NewAzApplicationInsightsAnnotation_CreateExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// 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)] @@ -89,6 +107,9 @@ public partial class NewAzApplicationInsightsAnnotation_CreateExpanded : global: PossibleTypes = new [] { typeof(global::System.DateTime) })] public global::System.DateTime EventTime { get => _annotationPropertiesBody.EventTime ?? default(global::System.DateTime); set => _annotationPropertiesBody.EventTime = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -126,7 +147,7 @@ public partial class NewAzApplicationInsightsAnnotation_CreateExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -208,7 +229,8 @@ public partial class NewAzApplicationInsightsAnnotation_CreateExpanded : global: [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -217,24 +239,24 @@ public partial class NewAzApplicationInsightsAnnotation_CreateExpanded : global: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -257,6 +279,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -321,8 +348,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -332,7 +384,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsAnnotation_CreateExpanded() { @@ -386,7 +438,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -399,12 +451,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.AnnotationsCreate(ResourceGroupName, SubscriptionId, ResourceName, _annotationPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.AnnotationsCreate(SubscriptionId, ResourceGroupName, ResourceName, _annotationPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -442,12 +494,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -464,15 +516,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, ResourceName=ResourceName, body=_annotationPropertiesBody }) + 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 } }); @@ -482,12 +534,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -499,9 +551,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaIdentity.cs index 3c6616f286aa..0b56f1f49808 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaIdentity.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create an Annotation of an Application Insights component. + /// 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_CreateViaIdentity", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an Annotation of an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations", ApiVersion = "2015-05-01")] public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentity : glob /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation _annotationProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation _annotationProperty; /// Annotation associated with an application insights resource. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Annotation associated with an application insights resource.", ValueFromPipeline = true)] @@ -45,14 +60,18 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentity : glob ReadOnly = false, Description = @"Annotation associated with an application insights resource.", SerializedName = @"annotationProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation AnnotationProperty { get => this._annotationProperty; set => this._annotationProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation AnnotationProperty { get => this._annotationProperty; set => this._annotationProperty = 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -66,6 +85,9 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +122,7 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentity : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -123,24 +145,24 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentity : glob /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -163,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -227,8 +254,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -238,7 +290,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsAnnotation_CreateViaIdentity() { @@ -292,7 +344,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -307,30 +359,30 @@ 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.AnnotationsCreateViaIdentity(InputObject.Id, AnnotationProperty, onOk, onDefault, this, Pipeline); + await this.Client.AnnotationsCreateViaIdentity(InputObject.Id, AnnotationProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); } 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.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.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.AnnotationsCreate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, AnnotationProperty, onOk, onDefault, this, Pipeline); + await this.Client.AnnotationsCreate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, AnnotationProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); } 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=AnnotationProperty}) + 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 } }); @@ -368,12 +420,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -390,15 +442,15 @@ protected override void StopProcessing() 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=AnnotationProperty }) + 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 { body=AnnotationProperty }) + 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 } }); @@ -408,12 +460,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -425,9 +477,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaIdentityExpanded.cs index 1473f9b2ae05..b26f2659a8d2 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaIdentityExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaIdentityExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create an Annotation of an Application Insights component. + /// 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_CreateViaIdentityExpanded", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an Annotation of an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations", ApiVersion = "2015-05-01")] public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,13 +34,25 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentityExpande 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation _annotationPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Annotation(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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)] @@ -54,6 +69,9 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentityExpande [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// 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)] @@ -89,6 +107,9 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentityExpande PossibleTypes = new [] { typeof(global::System.DateTime) })] public global::System.DateTime EventTime { get => _annotationPropertiesBody.EventTime ?? default(global::System.DateTime); set => _annotationPropertiesBody.EventTime = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -134,7 +155,7 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentityExpande /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -179,24 +200,24 @@ public partial class NewAzApplicationInsightsAnnotation_CreateViaIdentityExpande /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -219,6 +240,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -283,8 +309,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -294,7 +345,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsAnnotation_CreateViaIdentityExpanded() { @@ -348,7 +399,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -363,30 +414,30 @@ 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.AnnotationsCreateViaIdentity(InputObject.Id, _annotationPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.AnnotationsCreateViaIdentity(InputObject.Id, _annotationPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); } 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.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.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.AnnotationsCreate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, _annotationPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.AnnotationsCreate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _annotationPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); } 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=_annotationPropertiesBody}) + 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 } }); @@ -424,12 +475,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -446,15 +497,15 @@ protected override void StopProcessing() 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=_annotationPropertiesBody }) + 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 { body=_annotationPropertiesBody }) + 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 } }); @@ -464,12 +515,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -481,9 +532,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..baa1bbae9f88 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaJsonFilePath.cs @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an Annotation of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsAnnotation_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError + /// 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 System.Collections.Generic.List + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsAnnotation_CreateViaJsonFilePath() + { + + } + + /// 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, this.ExtensibleParameters); + 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.AnnotationsCreateViaJsonString(SubscriptionId, ResourceGroupName, ResourceName, _jsonString, 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,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName}) + { + 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError + /// 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 System.Collections.Generic.List + /// 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 System.Collections.Generic.List + var result = (await response); + // response should be returning an array of some kind. +Pageable + // array / / + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaJsonString.cs new file mode 100644 index 000000000000..68e7354d665b --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsAnnotation_CreateViaJsonString.cs @@ -0,0 +1,529 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an Annotation of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsAnnotation_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError + /// 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 System.Collections.Generic.List + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsAnnotation_CreateViaJsonString() + { + + } + + /// 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, this.ExtensibleParameters); + 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.AnnotationsCreateViaJsonString(SubscriptionId, ResourceGroupName, ResourceName, _jsonString, 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,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName}) + { + 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError + /// 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 System.Collections.Generic.List + /// 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 System.Collections.Generic.List + var result = (await response); + // response should be returning an array of some kind. +Pageable + // array / / + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateExpanded.cs index 45babcad7b2d..02600117e70b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create an API Key of an Application Insights component. + /// 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an API Key of an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys", ApiVersion = "2015-05-01")] public partial class NewAzApplicationInsightsApiKey_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,18 +34,33 @@ public partial class NewAzApplicationInsightsApiKey_CreateExpanded : global::Sys 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApiKeyRequest _apiKeyPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApiKeyRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -67,6 +85,9 @@ public partial class NewAzApplicationInsightsApiKey_CreateExpanded : global::Sys PossibleTypes = new [] { typeof(string) })] public string Description { get => _apiKeyPropertiesBody.Name ?? null; set => _apiKeyPropertiesBody.Name = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -92,7 +113,7 @@ public partial class NewAzApplicationInsightsApiKey_CreateExpanded : global::Sys 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; } + public string[] LinkedReadProperty { get => _apiKeyPropertiesBody.LinkedReadProperty?.ToArray() ?? null /* fixedArrayOf */; set => _apiKeyPropertiesBody.LinkedReadProperty = (value != null ? new System.Collections.Generic.List(value) : null); } /// The write access rights of this API Key. [global::System.Management.Automation.AllowEmptyCollection] @@ -104,7 +125,7 @@ public partial class NewAzApplicationInsightsApiKey_CreateExpanded : global::Sys 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; } + public string[] LinkedWriteProperty { get => _apiKeyPropertiesBody.LinkedWriteProperty?.ToArray() ?? null /* fixedArrayOf */; set => _apiKeyPropertiesBody.LinkedWriteProperty = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// cancellation delegate. Stops the cmdlet when called. @@ -132,7 +153,7 @@ public partial class NewAzApplicationInsightsApiKey_CreateExpanded : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -178,7 +199,8 @@ public partial class NewAzApplicationInsightsApiKey_CreateExpanded : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -187,12 +209,12 @@ public partial class NewAzApplicationInsightsApiKey_CreateExpanded : global::Sys /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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); + 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) @@ -215,6 +237,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -279,8 +306,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -290,7 +342,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsApiKey_CreateExpanded() { @@ -344,7 +396,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -357,12 +409,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.ApiKeysCreate(ResourceGroupName, SubscriptionId, Name, _apiKeyPropertiesBody, onOk, this, Pipeline); + await this.Client.ApiKeysCreate(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -398,12 +450,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -415,8 +467,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..a6ad0f861717 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateViaJsonFilePath.cs @@ -0,0 +1,471 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an API Key of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsApiKey_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsApiKey_CreateViaJsonFilePath() + { + + } + + /// 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, this.ExtensibleParameters); + 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.ApiKeysCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + /// 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.IApplicationInsightsComponentApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateViaJsonString.cs new file mode 100644 index 000000000000..03fe92fa2fe7 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsApiKey_CreateViaJsonString.cs @@ -0,0 +1,469 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an API Key of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsApiKey_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsApiKey_CreateViaJsonString() + { + + } + + /// 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, this.ExtensibleParameters); + 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.ApiKeysCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + /// 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.IApplicationInsightsComponentApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_Create.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_Create.cs index 7260de69556a..a626624a3765 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_Create.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_Create.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create a Continuous Export configuration of an Application Insights component. + /// 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_Create", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration", ApiVersion = "2015-05-01")] public partial class NewAzApplicationInsightsContinuousExport_Create : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class NewAzApplicationInsightsContinuousExport_Create : global::S /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -54,7 +72,7 @@ public partial class NewAzApplicationInsightsContinuousExport_Create : global::S public global::System.Management.Automation.PSObject DefaultProfile { get; set; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest _exportProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest _exportProperty; /// /// An Application Insights component Continuous Export configuration request definition. @@ -65,8 +83,12 @@ public partial class NewAzApplicationInsightsContinuousExport_Create : global::S ReadOnly = false, Description = @"An Application Insights component Continuous Export configuration request definition.", SerializedName = @"exportProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest ExportProperty { get => this._exportProperty; set => this._exportProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest ExportProperty { get => this._exportProperty; set => this._exportProperty = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// 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")] @@ -109,7 +131,7 @@ public partial class NewAzApplicationInsightsContinuousExport_Create : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -155,7 +177,8 @@ public partial class NewAzApplicationInsightsContinuousExport_Create : global::S [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -164,12 +187,12 @@ public partial class NewAzApplicationInsightsContinuousExport_Create : global::S /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -192,6 +215,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -256,8 +284,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -267,7 +320,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsContinuousExport_Create() { @@ -321,7 +374,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -334,12 +387,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.ExportConfigurationsCreate(ResourceGroupName, SubscriptionId, Name, ExportProperty, onOk, this, Pipeline); + await this.Client.ExportConfigurationsCreate(SubscriptionId, ResourceGroupName, Name, ExportProperty, 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=ExportProperty}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -375,12 +428,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -392,9 +445,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateExpanded.cs index 4609e16471b9..ea6cabefb937 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create a Continuous Export configuration of an Application Insights component. + /// 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration", ApiVersion = "2015-05-01")] public partial class NewAzApplicationInsightsContinuousExport_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,13 +41,28 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateExpanded : g /// /// 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest _exportPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportRequest(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -80,6 +98,9 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateExpanded : g PossibleTypes = new [] { typeof(string) })] public string DestinationType { get => _exportPropertiesBody.DestinationType ?? null; set => _exportPropertiesBody.DestinationType = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -156,7 +177,7 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -251,7 +272,8 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateExpanded : g [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -260,12 +282,12 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateExpanded : g /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -288,6 +310,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -352,8 +379,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -363,7 +415,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsContinuousExport_CreateExpanded() { @@ -417,7 +469,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -430,12 +482,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.ExportConfigurationsCreate(ResourceGroupName, SubscriptionId, Name, _exportPropertiesBody, onOk, this, Pipeline); + await this.Client.ExportConfigurationsCreate(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -471,12 +523,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -488,9 +540,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaIdentity.cs index 48213f99f8cc..2172b4707c86 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaIdentity.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create a Continuous Export configuration of an Application Insights component. + /// 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_CreateViaIdentity", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration", ApiVersion = "2015-05-01")] public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentity /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -54,7 +72,7 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentity public global::System.Management.Automation.PSObject DefaultProfile { get; set; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest _exportProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest _exportProperty; /// /// An Application Insights component Continuous Export configuration request definition. @@ -65,8 +83,12 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentity ReadOnly = false, Description = @"An Application Insights component Continuous Export configuration request definition.", SerializedName = @"exportProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest ExportProperty { get => this._exportProperty; set => this._exportProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest ExportProperty { get => this._exportProperty; set => this._exportProperty = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// 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")] @@ -102,7 +124,7 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentity /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -125,12 +147,12 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentity /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -153,6 +175,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -217,8 +244,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -228,7 +280,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsContinuousExport_CreateViaIdentity() { @@ -282,7 +334,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -302,25 +354,25 @@ protected override void ProcessRecord() 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.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.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.ExportConfigurationsCreate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, ExportProperty, onOk, this, Pipeline); + await this.Client.ExportConfigurationsCreate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, ExportProperty, 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=ExportProperty}) + 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 } }); @@ -356,12 +408,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -373,9 +425,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaIdentityExpanded.cs index 4794926cd9fe..bfbfd054ab9e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaIdentityExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaIdentityExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create a Continuous Export configuration of an Application Insights component. + /// 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_CreateViaIdentityExpanded", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration", ApiVersion = "2015-05-01")] public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,13 +41,28 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentityE /// /// 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest _exportPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportRequest(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -80,6 +98,9 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentityE PossibleTypes = new [] { typeof(string) })] public string DestinationType { get => _exportPropertiesBody.DestinationType ?? null; set => _exportPropertiesBody.DestinationType = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -149,7 +170,7 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentityE /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -221,12 +242,12 @@ public partial class NewAzApplicationInsightsContinuousExport_CreateViaIdentityE /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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); + 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) @@ -249,6 +270,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -313,8 +339,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -324,7 +375,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public NewAzApplicationInsightsContinuousExport_CreateViaIdentityExpanded() @@ -379,7 +430,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -399,25 +450,25 @@ protected override void ProcessRecord() 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.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.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.ExportConfigurationsCreate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, _exportPropertiesBody, onOk, this, Pipeline); + await this.Client.ExportConfigurationsCreate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _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 { body=_exportPropertiesBody}) + 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 } }); @@ -453,12 +504,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration[] + /// the body result as a System.Collections.Generic.List /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -470,9 +521,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..e0cffaa19837 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaJsonFilePath.cs @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsContinuousExport_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 System.Collections.Generic.List + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public NewAzApplicationInsightsContinuousExport_CreateViaJsonFilePath() + { + + } + + /// 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, this.ExtensibleParameters); + 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.ExportConfigurationsCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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 System.Collections.Generic.List + /// 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 System.Collections.Generic.List + var result = (await response); + // response should be returning an array of some kind. +Pageable + // array / / + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaJsonString.cs new file mode 100644 index 000000000000..c62e522444e2 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsContinuousExport_CreateViaJsonString.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsContinuousExport_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 System.Collections.Generic.List + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsContinuousExport_CreateViaJsonString() + { + + } + + /// 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, this.ExtensibleParameters); + 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.ExportConfigurationsCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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 System.Collections.Generic.List + /// 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 System.Collections.Generic.List + var result = (await response); + // response should be returning an array of some kind. +Pageable + // array / / + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded.cs index 9d2d6659de88..3ccbd458e8c9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Replace current linked storage account for an Application Insights component. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] public partial class NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,14 +37,29 @@ public partial class NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts _linkedStorageAccountsPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccounts(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -107,7 +128,7 @@ public partial class NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -153,7 +174,8 @@ public partial class NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -162,24 +184,24 @@ public partial class NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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); + 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) @@ -202,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -266,8 +293,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -277,7 +329,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsLinkedStorageAccount_CreateExpanded() { @@ -331,7 +383,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -344,12 +396,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.ComponentLinkedStorageAccountsCreateAndUpdate(ResourceGroupName, SubscriptionId, Name, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.ComponentLinkedStorageAccountsCreateAndUpdate(SubscriptionId, ResourceGroupName, Name, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,12 +439,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,15 +461,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_linkedStorageAccountsPropertiesBody }) + 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 } }); @@ -427,12 +479,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -444,8 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..d3312c0fc95f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonFilePath.cs @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonFilePath() + { + + } + + /// 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, this.ExtensibleParameters); + 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.ComponentLinkedStorageAccountsCreateAndUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + /// 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.IComponentLinkedStorageAccounts + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonString.cs new file mode 100644 index 000000000000..2e3a242c8524 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonString.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public NewAzApplicationInsightsLinkedStorageAccount_CreateViaJsonString() + { + + } + + /// 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, this.ExtensibleParameters); + 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.ComponentLinkedStorageAccountsCreateAndUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + /// 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.IComponentLinkedStorageAccounts + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateExpanded.cs index 97b2575de437..6f847ec0acb6 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create a new private workbook. + /// create a new private workbook. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsMyWorkbook_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"IdentityType","IdentityUserAssignedIdentity"}, NewOutputProperties=new string[] {"EnableSystemAssignedIdentity","UserAssignedIdentity"}, ChangeDescription="IdentityType will be removed. EnableSystemAssignedIdentity will be used to enable/disable system assigned identity and UserAssignedIdentity will be used to specify user assigned identities.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Create a new private workbook.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create a new private workbook.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}", ApiVersion = "2021-03-08")] public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +37,29 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// An Application Insights private workbook definition. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook _workbookPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.MyWorkbook(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook _workbookPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.MyWorkbook(); /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Workbook category, as defined by the user at creation time. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Workbook category, as defined by the user at creation time.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] @@ -78,6 +95,10 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workbookPropertiesBody.DisplayName ?? null; set => _workbookPropertiesBody.DisplayName = value; } + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _workbookPropertiesBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + /// Resource etag [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource etag")] @@ -87,8 +108,11 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: ReadOnly = false, Description = @"Resource etag", SerializedName = @"etag", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceEtag Etag { get => _workbookPropertiesBody.Etag ?? null /* object */; set => _workbookPropertiesBody.Etag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceEtag Etag { get => _workbookPropertiesBody.Etag ?? null /* object */; set => _workbookPropertiesBody.Etag = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// Azure resource name [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource name")] @@ -125,17 +149,6 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: PossibleTypes = new [] { typeof(string) })] public string Id { get => _workbookPropertiesBody.Id ?? null; set => _workbookPropertiesBody.Id = value; } - /// The identity type. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The identity type.")] - [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 identity type.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - public string IdentityType { get => _workbookPropertiesBody.IdentityType ?? null; set => _workbookPropertiesBody.IdentityType = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -147,14 +160,15 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: ReadOnly = false, Description = @"The kind of workbook. Choices are user and shared.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind) })] + PossibleTypes = new [] { typeof(string) })] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"""user""")] + Script = @"""user""", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind Kind { get => _workbookPropertiesBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind)""); set => _workbookPropertiesBody.Kind = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("user", "shared")] + public string Kind { get => _workbookPropertiesBody.Kind ?? null; set => _workbookPropertiesBody.Kind = value; } /// Backing field for property. private string _linkedSourceId; @@ -206,7 +220,7 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -274,7 +288,7 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: Description = @"A list of 0 or more tags that are associated with this private workbook definition", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - public string[] SourceTag { get => _workbookPropertiesBody.PropertiesTag ?? null /* arrayOf */; set => _workbookPropertiesBody.PropertiesTag = value; } + public string[] SourceTag { get => _workbookPropertiesBody.PropertiesTag?.ToArray() ?? null /* fixedArrayOf */; set => _workbookPropertiesBody.PropertiesTag = (value != null ? new System.Collections.Generic.List(value) : null); } /// BYOS Storage Account URI [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "BYOS Storage Account URI")] @@ -301,7 +315,8 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -314,8 +329,8 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags Tag { get => _workbookPropertiesBody.Tag ?? null /* object */; set => _workbookPropertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResourceTags Tag { get => _workbookPropertiesBody.Tag ?? null /* object */; set => _workbookPropertiesBody.Tag = value; } /// Azure resource type [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource type")] @@ -346,36 +361,36 @@ public partial class NewAzApplicationInsightsMyWorkbook_CreateExpanded : global: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// 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); + 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) @@ -398,6 +413,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -462,8 +482,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -473,7 +518,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsMyWorkbook_CreateExpanded() { @@ -527,7 +572,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -537,15 +582,23 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("HideName")) + { + HideName = (string)this.MyInvocation.BoundParameters["HideName"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("Kind")) + { + Kind = (string)this.MyInvocation.BoundParameters["Kind"]; + } 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.MyWorkbooksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookPropertiesBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.MyWorkbooksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookPropertiesBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null,body=_workbookPropertiesBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -581,12 +634,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -598,8 +651,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -607,12 +678,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -629,15 +700,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=_workbookPropertiesBody }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=_workbookPropertiesBody }) + 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 } }); @@ -647,12 +718,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -664,8 +735,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..4fc50b89cbad --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateViaJsonFilePath.cs @@ -0,0 +1,591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// create a new private workbook. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsMyWorkbook_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create a new private workbook.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}", ApiVersion = "2021-03-08")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsMyWorkbook_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// Backing field for property. + private string _linkedSourceId; + + /// Azure Resource Id that will fetch all linked workbooks. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure Resource Id that will fetch all linked workbooks.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Id that will fetch all linked workbooks.", + SerializedName = @"sourceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] + public string LinkedSourceId { get => this._linkedSourceId; set => this._linkedSourceId = 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::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. + /// + public 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", + SetCondition = @"")] + [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; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsMyWorkbook_CreateViaJsonFilePath() + { + + } + + /// 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 'MyWorkbooksCreateOrUpdate' 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, this.ExtensibleParameters); + 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.MyWorkbooksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _jsonString, onOk, onCreated, 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) + { + 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + /// 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.IMyWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateViaJsonString.cs new file mode 100644 index 000000000000..ec4c20a05b5c --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsMyWorkbook_CreateViaJsonString.cs @@ -0,0 +1,589 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// create a new private workbook. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsMyWorkbook_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create a new private workbook.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}", ApiVersion = "2021-03-08")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsMyWorkbook_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// Backing field for property. + private string _linkedSourceId; + + /// Azure Resource Id that will fetch all linked workbooks. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure Resource Id that will fetch all linked workbooks.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Id that will fetch all linked workbooks.", + SerializedName = @"sourceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] + public string LinkedSourceId { get => this._linkedSourceId; set => this._linkedSourceId = 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::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. + /// + public 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", + SetCondition = @"")] + [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; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsMyWorkbook_CreateViaJsonString() + { + + } + + /// 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 'MyWorkbooksCreateOrUpdate' 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, this.ExtensibleParameters); + 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.MyWorkbooksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _jsonString, onOk, onCreated, 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) + { + 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + /// 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.IMyWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateExpanded.cs index 96302d21c575..013509d999ec 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Creates or updates an Application Insights web test definition. + /// create an Application Insights web test definition. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsWebTest_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Creates or updates an Application Insights web test definition.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an Application Insights web test definition.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +38,29 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// An Application Insights WebTest definition. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest _webTestDefinitionBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.WebTest(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest _webTestDefinitionBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -125,6 +143,9 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy 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; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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)] @@ -147,8 +168,8 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy 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.Api20220615.IWebTestGeolocation) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] GeoLocation { get => _webTestDefinitionBody.PropertiesLocations ?? null /* arrayOf */; set => _webTestDefinitionBody.PropertiesLocations = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestGeolocation[] GeoLocation { get => _webTestDefinitionBody.Locations?.ToArray() ?? null /* fixedArrayOf */; set => _webTestDefinitionBody.Locations = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The kind of WebTest that this web test watches. Choices are ping, multistep and standard. @@ -160,10 +181,10 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy ReadOnly = false, Description = @"The kind of WebTest that this web test watches. Choices are ping, multistep and standard.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind) })] + PossibleTypes = new [] { typeof(string) })] [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; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + public string HideKind { get => _webTestDefinitionBody.Kind ?? null; 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")] @@ -188,9 +209,9 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy 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 Kind { get => _webTestDefinitionBody.WebTestKind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum)""); set => _webTestDefinitionBody.WebTestKind = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + public string Kind { get => _webTestDefinitionBody.WebTestKind ?? null; set => _webTestDefinitionBody.WebTestKind = value; } /// Resource location [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location")] @@ -229,7 +250,7 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -278,8 +299,8 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy 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.Api20220615.IHeaderField) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] RequestHeader { get => _webTestDefinitionBody.RequestHeader ?? null /* arrayOf */; set => _webTestDefinitionBody.RequestHeader = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IHeaderField[] RequestHeader { get => _webTestDefinitionBody.RequestHeader?.ToArray() ?? null /* fixedArrayOf */; set => _webTestDefinitionBody.RequestHeader = (value != null ? new System.Collections.Generic.List(value) : null); } /// Http verb to use for this web test. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Http verb to use for this web test.")] @@ -400,7 +421,8 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -425,8 +447,8 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags Tag { get => _webTestDefinitionBody.Tag ?? null /* object */; set => _webTestDefinitionBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.")] @@ -455,12 +477,12 @@ public partial class NewAzApplicationInsightsWebTest_CreateExpanded : global::Sy /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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); + 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) @@ -483,6 +505,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -547,8 +574,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -558,7 +610,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsWebTest_CreateExpanded() { @@ -612,7 +664,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -622,15 +674,23 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("HideKind")) + { + HideKind = (string)this.MyInvocation.BoundParameters["HideKind"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("SyntheticMonitorId")) + { + SyntheticMonitorId = (string)this.MyInvocation.BoundParameters["SyntheticMonitorId"]; + } 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(SubscriptionId, ResourceGroupName, Name, _webTestDefinitionBody, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -666,12 +726,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -683,8 +743,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..84ecc96e3485 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateViaJsonFilePath.cs @@ -0,0 +1,471 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// create an Application Insights web test definition. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsWebTest_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an Application Insights web test definition.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsWebTest_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsWebTest_CreateViaJsonFilePath() + { + + } + + /// 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, this.ExtensibleParameters); + 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.WebTestsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + /// 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.IWebTest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateViaJsonString.cs new file mode 100644 index 000000000000..af6bd32920ab --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWebTest_CreateViaJsonString.cs @@ -0,0 +1,469 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// create an Application Insights web test definition. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsWebTest_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create an Application Insights web test definition.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsWebTest_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsWebTest_CreateViaJsonString() + { + + } + + /// 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, this.ExtensibleParameters); + 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.WebTestsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + /// 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.IWebTest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateExpanded.cs index 7e0708a5fa1f..2e8cd59fe0bc 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create a new workbook template. + /// create a new workbook template. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsWorkbookTemplate_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Gallery"}, NewOutputProperties=new string[] {"Gallery"}, ChangeDescription="The type of property 'Gallery' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Create a new workbook template.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create a new workbook template.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,20 @@ public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : g /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// An Application Insights workbook template definition. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate _workbookTemplatePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplate(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate _workbookTemplatePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplate(); /// Information about the author of the workbook template. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the author of the workbook template.")] @@ -54,6 +68,9 @@ public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -67,6 +84,9 @@ public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Workbook galleries supported by the template. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Workbook galleries supported by the template.")] @@ -76,8 +96,8 @@ public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : g ReadOnly = false, Description = @"Workbook galleries supported by the template.", SerializedName = @"galleries", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get => _workbookTemplatePropertiesBody.Gallery ?? null /* arrayOf */; set => _workbookTemplatePropertiesBody.Gallery = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery[] Gallery { get => _workbookTemplatePropertiesBody.Gallery?.ToArray() ?? null /* fixedArrayOf */; set => _workbookTemplatePropertiesBody.Gallery = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -105,8 +125,8 @@ public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : g ReadOnly = false, Description = @"Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.", SerializedName = @"localized", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get => _workbookTemplatePropertiesBody.Localized ?? null /* object */; set => _workbookTemplatePropertiesBody.Localized = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get => _workbookTemplatePropertiesBody.Localized ?? null /* object */; set => _workbookTemplatePropertiesBody.Localized = value; } /// Resource location [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource location")] @@ -144,7 +164,7 @@ public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. @@ -203,7 +223,8 @@ public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : g [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -216,8 +237,8 @@ public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : g ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceTags Tag { get => _workbookTemplatePropertiesBody.Tag ?? null /* object */; set => _workbookTemplatePropertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateResourceTags Tag { get => _workbookTemplatePropertiesBody.Tag ?? null /* object */; set => _workbookTemplatePropertiesBody.Tag = value; } /// Valid JSON object containing workbook template payload. [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -228,44 +249,44 @@ public partial class NewAzApplicationInsightsWorkbookTemplate_CreateExpanded : g ReadOnly = false, Description = @"Valid JSON object containing workbook template payload.", SerializedName = @"templateData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get => _workbookTemplatePropertiesBody.TemplateData ?? null /* object */; set => _workbookTemplatePropertiesBody.TemplateData = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get => _workbookTemplatePropertiesBody.TemplateData ?? null /* object */; set => _workbookTemplatePropertiesBody.TemplateData = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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); + 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) @@ -288,6 +309,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -352,8 +378,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -363,7 +414,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsWorkbookTemplate_CreateExpanded() { @@ -417,7 +468,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -430,12 +481,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.WorkbookTemplatesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _workbookTemplatePropertiesBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.WorkbookTemplatesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _workbookTemplatePropertiesBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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,ResourceGroupName=ResourceGroupName,Name=Name,body=_workbookTemplatePropertiesBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -471,12 +522,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -488,8 +539,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -497,12 +566,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -519,15 +588,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name, body=_workbookTemplatePropertiesBody }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_workbookTemplatePropertiesBody }) + 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 } }); @@ -537,12 +606,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -554,8 +623,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..df3b1842a001 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonFilePath.cs @@ -0,0 +1,578 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// create a new workbook template. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsWorkbookTemplate_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create a new workbook template.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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::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. + /// + public 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", + SetCondition = @"")] + [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; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonFilePath() + { + + } + + /// 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 'WorkbookTemplatesCreateOrUpdate' 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, this.ExtensibleParameters); + 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.WorkbookTemplatesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// 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.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonString.cs new file mode 100644 index 000000000000..ae208abad612 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonString.cs @@ -0,0 +1,575 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// create a new workbook template. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsWorkbookTemplate_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create a new workbook template.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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::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. + /// + public 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", + SetCondition = @"")] + [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; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsWorkbookTemplate_CreateViaJsonString() + { + + } + + /// 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 'WorkbookTemplatesCreateOrUpdate' 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, this.ExtensibleParameters); + 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.WorkbookTemplatesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// 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.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateExpanded.cs index 333e8a5895b9..ed2e7aadfbd5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Create a new workbook. + /// create a new workbook. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsWorkbook_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Create a new workbook.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create a new workbook.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +37,29 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// A workbook definition. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook _workbookPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.Workbook(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook _workbookPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Workbook(); /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Workbook category, as defined by the user at creation time. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Workbook category, as defined by the user at creation time.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] @@ -89,6 +106,10 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workbookPropertiesBody.DisplayName ?? null; set => _workbookPropertiesBody.DisplayName = value; } + /// Determines whether to enable a system-assigned identity for the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines whether to enable a system-assigned identity for the resource.")] + public global::System.Management.Automation.SwitchParameter EnableSystemAssignedIdentity { set => _workbookPropertiesBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + /// 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)] @@ -100,6 +121,9 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S PossibleTypes = new [] { typeof(string) })] public string Etag { get => _workbookPropertiesBody.Etag ?? null; set => _workbookPropertiesBody.Etag = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -112,36 +136,6 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S [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; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).")] - [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 managed service identity (where both SystemAssigned and UserAssigned types are allowed).", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType IdentityType { get => _workbookPropertiesBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType)""); set => _workbookPropertiesBody.IdentityType = value; } - - /// - /// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM - /// resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - /// The dictionary values can be empty objects ({}) in requests. - /// - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.")] - [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 set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - SerializedName = @"userAssignedIdentities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _workbookPropertiesBody.IdentityUserAssignedIdentity ?? null /* object */; set => _workbookPropertiesBody.IdentityUserAssignedIdentity = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -153,14 +147,15 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S ReadOnly = false, Description = @"The kind of workbook. Only valid value is shared.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind) })] + PossibleTypes = new [] { typeof(string) })] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"""shared""")] + Script = @"""shared""", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind Kind { get => _workbookPropertiesBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind)""); set => _workbookPropertiesBody.Kind = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("shared")] + public string Kind { get => _workbookPropertiesBody.Kind ?? null; set => _workbookPropertiesBody.Kind = value; } /// Backing field for property. private string _linkedSourceId; @@ -212,7 +207,7 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -278,7 +273,7 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S Description = @"Being deprecated, please use the other tags field", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - public string[] SourceTag { get => _workbookPropertiesBody.PropertiesTag ?? null /* arrayOf */; set => _workbookPropertiesBody.PropertiesTag = value; } + public string[] SourceTag { get => _workbookPropertiesBody.PropertiesTag?.ToArray() ?? null /* fixedArrayOf */; set => _workbookPropertiesBody.PropertiesTag = (value != null ? new System.Collections.Generic.List(value) : null); } /// The resourceId to the storage account when bring your own storage is used [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resourceId to the storage account when bring your own storage is used")] @@ -305,7 +300,8 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -318,8 +314,16 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags Tag { get => _workbookPropertiesBody.Tag ?? null /* object */; set => _workbookPropertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags Tag { get => _workbookPropertiesBody.Tag ?? null /* object */; set => _workbookPropertiesBody.Tag = value; } + + /// + /// The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in + /// the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'")] + [global::System.Management.Automation.AllowEmptyCollection] + public string[] UserAssignedIdentity { get; set; } /// /// Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData @@ -339,36 +343,36 @@ public partial class NewAzApplicationInsightsWorkbook_CreateExpanded : global::S /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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); + 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) @@ -391,6 +395,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -455,8 +464,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -466,13 +500,38 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsightsWorkbook_CreateExpanded() { } + private void PreProcessManagedIdentityParameters() + { + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _workbookPropertiesBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _workbookPropertiesBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentity()); + } + } + // calculate IdentityType + if (this.UserAssignedIdentity?.Length > 0) + { + if ("SystemAssigned".Equals(_workbookPropertiesBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) + { + _workbookPropertiesBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else + { + _workbookPropertiesBody.IdentityType = "UserAssigned"; + } + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -520,7 +579,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -530,15 +589,20 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("Kind")) + { + Kind = (string)this.MyInvocation.BoundParameters["Kind"]; + } 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.WorkbooksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookPropertiesBody, onOk, onCreated, onDefault, this, Pipeline); + this.PreProcessManagedIdentityParameters(); + await this.Client.WorkbooksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookPropertiesBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null,body=_workbookPropertiesBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -574,12 +638,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -591,8 +655,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -600,12 +682,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -622,15 +704,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=_workbookPropertiesBody }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=_workbookPropertiesBody }) + 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 } }); @@ -640,12 +722,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -657,8 +739,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..fc85f3b0d4b7 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateViaJsonFilePath.cs @@ -0,0 +1,591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// create a new workbook. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsWorkbook_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create a new workbook.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsWorkbook_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// Backing field for property. + private string _linkedSourceId; + + /// Azure Resource Id that will fetch all linked workbooks. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure Resource Id that will fetch all linked workbooks.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Id that will fetch all linked workbooks.", + SerializedName = @"sourceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] + public string LinkedSourceId { get => this._linkedSourceId; set => this._linkedSourceId = 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 resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [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. + /// + public 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", + SetCondition = @"")] + [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; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsWorkbook_CreateViaJsonFilePath() + { + + } + + /// 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 'WorkbooksCreateOrUpdate' 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, this.ExtensibleParameters); + 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.WorkbooksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _jsonString, onOk, onCreated, 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) + { + 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateViaJsonString.cs new file mode 100644 index 000000000000..e6bca1405659 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsightsWorkbook_CreateViaJsonString.cs @@ -0,0 +1,589 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// create a new workbook. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsightsWorkbook_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create a new workbook.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsightsWorkbook_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// Backing field for property. + private string _linkedSourceId; + + /// Azure Resource Id that will fetch all linked workbooks. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure Resource Id that will fetch all linked workbooks.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Id that will fetch all linked workbooks.", + SerializedName = @"sourceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] + public string LinkedSourceId { get => this._linkedSourceId; set => this._linkedSourceId = 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 resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [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. + /// + public 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", + SetCondition = @"")] + [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; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsightsWorkbook_CreateViaJsonString() + { + + } + + /// 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 'WorkbooksCreateOrUpdate' 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, this.ExtensibleParameters); + 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.WorkbooksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _jsonString, onOk, onCreated, 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) + { + 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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_Create.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_Create.cs index 158e3801b562..4483e0f4a8f1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_Create.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_Create.cs @@ -6,10 +6,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// create (or create an Application Insights component. Note: You cannot specify a different value for InstrumentationKey /// nor AppId in the Put operation. /// /// @@ -17,12 +19,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsights_Create", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create (or create 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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class NewAzApplicationInsights_Create : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,11 +41,26 @@ public partial class NewAzApplicationInsights_Create : global::System.Management /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -56,6 +74,9 @@ public partial class NewAzApplicationInsights_Create : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -69,7 +90,7 @@ public partial class NewAzApplicationInsights_Create : global::System.Management public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent _insightProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent _insightProperty; /// An Application Insights component definition. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "An Application Insights component definition.", ValueFromPipeline = true)] @@ -78,8 +99,9 @@ public partial class NewAzApplicationInsights_Create : global::System.Management ReadOnly = false, Description = @"An Application Insights component definition.", SerializedName = @"insightProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent InsightProperty { get => this._insightProperty; set => this._insightProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent InsightProperty { get => this._insightProperty; set => this._insightProperty = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -110,7 +132,7 @@ public partial class NewAzApplicationInsights_Create : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -156,7 +178,8 @@ public partial class NewAzApplicationInsights_Create : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -165,24 +188,24 @@ public partial class NewAzApplicationInsights_Create : global::System.Management /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -205,6 +228,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -269,8 +297,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -280,7 +333,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsights_Create() { @@ -334,7 +387,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -347,12 +400,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.ComponentsCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, InsightProperty, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, InsightProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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=InsightProperty}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -390,12 +443,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,15 +465,15 @@ protected override void StopProcessing() 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=InsightProperty }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=InsightProperty }) + 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 } }); @@ -430,12 +483,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -447,8 +500,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateExpanded.cs index 8d41e182e4a4..edfd091d19f3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateExpanded.cs @@ -6,10 +6,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// create (or create an Application Insights component. Note: You cannot specify a different value for InstrumentationKey /// nor AppId in the Put operation. /// /// @@ -17,12 +19,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create (or create 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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class NewAzApplicationInsights_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,8 +41,20 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// An Application Insights component definition. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent _insightPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent _insightPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponent(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Type of application being monitored. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of application being monitored.")] @@ -49,15 +64,18 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] + public string ApplicationType { get => _insightPropertiesBody.ApplicationType ?? null; 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -104,6 +122,9 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma PossibleTypes = new [] { typeof(string) })] public string Etag { get => _insightPropertiesBody.Etag ?? null; set => _insightPropertiesBody.Etag = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// /// 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. @@ -115,9 +136,9 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] + public string FlowType { get => _insightPropertiesBody.FlowType ?? null; 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.")] @@ -132,13 +153,14 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma /// /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// Please visit external url https://aka.ms/ewjuel to get more information. /// - [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::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. Please visit external url https://aka.ms/ewjuel to get more information.")] [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.", + Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. Please visit external url https://aka.ms/ewjuel to get more information.", SerializedName = @"HockeyAppId", PossibleTypes = new [] { typeof(string) })] public string HockeyAppId { get => _insightPropertiesBody.HockeyAppId ?? null; set => _insightPropertiesBody.HockeyAppId = value; } @@ -174,9 +196,9 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] + public string IngestionMode { get => _insightPropertiesBody.IngestionMode ?? null; 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; } } @@ -232,7 +254,7 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -258,9 +280,9 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccessForIngestion { get => _insightPropertiesBody.PublicNetworkAccessForIngestion ?? null; 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.")] @@ -270,9 +292,9 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccessForQuery { get => _insightPropertiesBody.PublicNetworkAccessForQuery ?? null; set => _insightPropertiesBody.PublicNetworkAccessForQuery = value; } /// /// Describes what tool created this Application Insights component. Customers using this API should set this to the default @@ -285,9 +307,9 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] + public string RequestSource { get => _insightPropertiesBody.RequestSource ?? null; set => _insightPropertiesBody.RequestSource = value; } /// Backing field for property. private string _resourceGroupName; @@ -316,13 +338,14 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma /// /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// Please visit external url https://aka.ms/sl0yqd to get more information. /// - [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::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. Please visit external url https://aka.ms/sl0yqd to get more information.")] [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.", + Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. Please visit external url https://aka.ms/sl0yqd to get more information.", SerializedName = @"SamplingPercentage", PossibleTypes = new [] { typeof(double) })] public double SamplingPercentage { get => _insightPropertiesBody.SamplingPercentage ?? default(double); set => _insightPropertiesBody.SamplingPercentage = value; } @@ -341,7 +364,8 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -354,8 +378,8 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 @@ -376,24 +400,24 @@ public partial class NewAzApplicationInsights_CreateExpanded : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -416,6 +440,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -480,8 +509,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -491,7 +545,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsights_CreateExpanded() { @@ -545,7 +599,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -558,12 +612,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.ComponentsCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, _insightPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _insightPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -601,12 +655,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -623,15 +677,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_insightPropertiesBody }) + 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 } }); @@ -641,12 +695,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -658,8 +712,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaIdentity.cs index 8d0344852b54..0b4b2eb8d025 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaIdentity.cs @@ -6,10 +6,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// create (or create an Application Insights component. Note: You cannot specify a different value for InstrumentationKey /// nor AppId in the Put operation. /// /// @@ -17,12 +19,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsights_CreateViaIdentity", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create (or create 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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class NewAzApplicationInsights_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,11 +41,26 @@ public partial class NewAzApplicationInsights_CreateViaIdentity : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -56,6 +74,9 @@ public partial class NewAzApplicationInsights_CreateViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -77,7 +98,7 @@ public partial class NewAzApplicationInsights_CreateViaIdentity : global::System public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent _insightProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent _insightProperty; /// An Application Insights component definition. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "An Application Insights component definition.", ValueFromPipeline = true)] @@ -86,8 +107,9 @@ public partial class NewAzApplicationInsights_CreateViaIdentity : global::System ReadOnly = false, Description = @"An Application Insights component definition.", SerializedName = @"insightProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent InsightProperty { get => this._insightProperty; set => this._insightProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent InsightProperty { get => this._insightProperty; set => this._insightProperty = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -103,7 +125,7 @@ public partial class NewAzApplicationInsights_CreateViaIdentity : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -126,24 +148,24 @@ public partial class NewAzApplicationInsights_CreateViaIdentity : global::System /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -166,6 +188,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -230,8 +257,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -241,7 +293,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsights_CreateViaIdentity() { @@ -295,7 +347,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,30 +362,30 @@ 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.ComponentsCreateOrUpdateViaIdentity(InputObject.Id, InsightProperty, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsCreateOrUpdateViaIdentity(InputObject.Id, InsightProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); } 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.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.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.ComponentsCreateOrUpdate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, InsightProperty, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InsightProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); } 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=InsightProperty}) + 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 } }); @@ -371,12 +423,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -393,15 +445,15 @@ protected override void StopProcessing() 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=InsightProperty }) + 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 { body=InsightProperty }) + 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 } }); @@ -411,12 +463,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -428,8 +480,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaIdentityExpanded.cs index 3fbe88ff7c3a..8382f206cfd5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaIdentityExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaIdentityExpanded.cs @@ -6,10 +6,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// create (or create an Application Insights component. Note: You cannot specify a different value for InstrumentationKey /// nor AppId in the Put operation. /// /// @@ -17,12 +19,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzApplicationInsights_CreateViaIdentityExpanded", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create (or create 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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,8 +41,20 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// An Application Insights component definition. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent _insightPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent _insightPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponent(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Type of application being monitored. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of application being monitored.")] @@ -49,15 +64,18 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] + public string ApplicationType { get => _insightPropertiesBody.ApplicationType ?? null; 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -104,6 +122,9 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global PossibleTypes = new [] { typeof(string) })] public string Etag { get => _insightPropertiesBody.Etag ?? null; set => _insightPropertiesBody.Etag = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// /// 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. @@ -115,9 +136,9 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] + public string FlowType { get => _insightPropertiesBody.FlowType ?? null; 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.")] @@ -132,13 +153,14 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global /// /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// Please visit external url https://aka.ms/ewjuel to get more information. /// - [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::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. Please visit external url https://aka.ms/ewjuel to get more information.")] [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.", + Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. Please visit external url https://aka.ms/ewjuel to get more information.", SerializedName = @"HockeyAppId", PossibleTypes = new [] { typeof(string) })] public string HockeyAppId { get => _insightPropertiesBody.HockeyAppId ?? null; set => _insightPropertiesBody.HockeyAppId = value; } @@ -174,9 +196,9 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] + public string IngestionMode { get => _insightPropertiesBody.IngestionMode ?? null; set => _insightPropertiesBody.IngestionMode = value; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _inputObject; @@ -225,7 +247,7 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -251,9 +273,9 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccessForIngestion { get => _insightPropertiesBody.PublicNetworkAccessForIngestion ?? null; 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.")] @@ -263,9 +285,9 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccessForQuery { get => _insightPropertiesBody.PublicNetworkAccessForQuery ?? null; set => _insightPropertiesBody.PublicNetworkAccessForQuery = value; } /// /// Describes what tool created this Application Insights component. Customers using this API should set this to the default @@ -278,9 +300,9 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] + public string RequestSource { get => _insightPropertiesBody.RequestSource ?? null; set => _insightPropertiesBody.RequestSource = value; } /// Retention period in days. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Retention period in days.")] @@ -295,13 +317,14 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global /// /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// Please visit external url https://aka.ms/sl0yqd to get more information. /// - [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::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. Please visit external url https://aka.ms/sl0yqd to get more information.")] [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.", + Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. Please visit external url https://aka.ms/sl0yqd to get more information.", SerializedName = @"SamplingPercentage", PossibleTypes = new [] { typeof(double) })] public double SamplingPercentage { get => _insightPropertiesBody.SamplingPercentage ?? default(double); set => _insightPropertiesBody.SamplingPercentage = value; } @@ -315,8 +338,8 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 @@ -337,24 +360,24 @@ public partial class NewAzApplicationInsights_CreateViaIdentityExpanded : global /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -377,6 +400,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -441,8 +469,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -452,7 +505,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzApplicationInsights_CreateViaIdentityExpanded() { @@ -506,7 +559,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -521,30 +574,30 @@ 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.ComponentsCreateOrUpdateViaIdentity(InputObject.Id, _insightPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsCreateOrUpdateViaIdentity(InputObject.Id, _insightPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); } 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.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.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.ComponentsCreateOrUpdate(InputObject.ResourceGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceName ?? null, _insightPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _insightPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); } 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=_insightPropertiesBody}) + 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 } }); @@ -582,12 +635,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -604,15 +657,15 @@ protected override void StopProcessing() 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=_insightPropertiesBody }) + 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 { body=_insightPropertiesBody }) + 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 } }); @@ -622,12 +675,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -639,8 +692,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..d1468a4b5f15 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaJsonFilePath.cs @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// + /// create (or create 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_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create (or create 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsights_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsights_CreateViaJsonFilePath() + { + + } + + /// 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, this.ExtensibleParameters); + 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.ComponentsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaJsonString.cs new file mode 100644 index 000000000000..237ee5d63f38 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/NewAzApplicationInsights_CreateViaJsonString.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// + /// create (or create 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_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"create (or create 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class NewAzApplicationInsights_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzApplicationInsights_CreateViaJsonString() + { + + } + + /// 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, this.ExtensibleParameters); + 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.ComponentsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_Delete.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_Delete.cs index 84490bdcd3da..018b33329746 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_Delete.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete an Annotation of an Application Insights component. @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}", ApiVersion = "2015-05-01")] public partial class RemoveAzApplicationInsightsAnnotation_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class RemoveAzApplicationInsightsAnnotation_Delete : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class RemoveAzApplicationInsightsAnnotation_Delete : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -103,7 +124,7 @@ public partial class RemoveAzApplicationInsightsAnnotation_Delete : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -163,7 +184,8 @@ public partial class RemoveAzApplicationInsightsAnnotation_Delete : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -198,6 +220,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -262,8 +289,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -319,7 +371,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -332,12 +384,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.AnnotationsDelete(ResourceGroupName, SubscriptionId, ResourceName, Id, onOk, this, Pipeline); + await this.Client.AnnotationsDelete(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ResourceName=ResourceName,Id=Id}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -350,7 +402,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsAnnotation_Delete() { @@ -396,7 +448,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity.cs index e1d677fc0591..eb9f8690eb97 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete an Annotation of an Application Insights component. @@ -19,7 +21,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}", ApiVersion = "2015-05-01")] public partial class RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity : g /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +115,7 @@ public partial class RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -143,6 +164,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -207,8 +233,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -264,7 +315,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -284,14 +335,14 @@ protected override void ProcessRecord() 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.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.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) ); @@ -300,13 +351,13 @@ protected override void ProcessRecord() { 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 this.Client.AnnotationsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsAnnotation_DeleteViaIdentity() { @@ -365,7 +416,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentityComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentityComponent.cs new file mode 100644 index 000000000000..9e9fe813d22b --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsAnnotation_DeleteViaIdentityComponent.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_DeleteViaIdentityComponent", 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}", ApiVersion = "2015-05-01")] + public partial class RemoveAzApplicationInsightsAnnotation_DeleteViaIdentityComponent : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _componentInputObject; + + /// 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 ComponentInputObject { get => this._componentInputObject; set => this._componentInputObject = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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 (ComponentInputObject?.Id != null) + { + this.ComponentInputObject.Id += $"/Annotations/{(global::System.Uri.EscapeDataString(this.Id.ToString()))}"; + await this.Client.AnnotationsDeleteViaIdentity(ComponentInputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ComponentInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + await this.Client.AnnotationsDelete(ComponentInputObject.SubscriptionId ?? null, ComponentInputObject.ResourceGroupName ?? null, ComponentInputObject.ResourceName ?? null, 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 { 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); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzApplicationInsightsAnnotation_DeleteViaIdentityComponent() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// 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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_Delete.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_Delete.cs index 5d7dc9b05e69..2a387f2b6593 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_Delete.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete an API Key of an Application Insights component. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, NewOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, ChangeDescription="The types of the properties LinkedReadProperty, LinkedWriteProperty will be changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete an API Key of an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}", ApiVersion = "2015-05-01")] public partial class RemoveAzApplicationInsightsApiKey_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +37,18 @@ public partial class RemoveAzApplicationInsightsApiKey_Delete : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _apiKeyId; @@ -54,6 +68,9 @@ public partial class RemoveAzApplicationInsightsApiKey_Delete : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -67,6 +84,9 @@ public partial class RemoveAzApplicationInsightsApiKey_Delete : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -108,7 +128,7 @@ public partial class RemoveAzApplicationInsightsApiKey_Delete : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -154,7 +174,8 @@ public partial class RemoveAzApplicationInsightsApiKey_Delete : global::System.M [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -163,12 +184,12 @@ public partial class RemoveAzApplicationInsightsApiKey_Delete : global::System.M /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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); + 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) @@ -191,6 +212,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -255,8 +281,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -312,7 +363,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -325,12 +376,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.ApiKeysDelete(ResourceGroupName, SubscriptionId, Name, ApiKeyId, onOk, this, Pipeline); + await this.Client.ApiKeysDelete(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,ApiKeyId=ApiKeyId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -343,7 +394,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsApiKey_Delete() { @@ -374,12 +425,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,8 +442,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentity.cs index 12df727e44e6..0ee8de2ee0d4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete an API Key of an Application Insights component. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, NewOutputProperties=new string[] {"LinkedReadProperty","LinkedWriteProperty"}, ChangeDescription="The types of the properties LinkedReadProperty, LinkedWriteProperty will be changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey))] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete an API Key of an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}", ApiVersion = "2015-05-01")] public partial class RemoveAzApplicationInsightsApiKey_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class RemoveAzApplicationInsightsApiKey_DeleteViaIdentity : globa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class RemoveAzApplicationInsightsApiKey_DeleteViaIdentity : globa [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +107,7 @@ public partial class RemoveAzApplicationInsightsApiKey_DeleteViaIdentity : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -110,12 +130,12 @@ public partial class RemoveAzApplicationInsightsApiKey_DeleteViaIdentity : globa /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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); + 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) @@ -138,6 +158,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -202,8 +227,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -259,7 +309,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -279,14 +329,14 @@ protected override void ProcessRecord() 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.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.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) ); @@ -295,13 +345,13 @@ protected override void ProcessRecord() { 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 this.Client.ApiKeysDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsApiKey_DeleteViaIdentity() { @@ -345,12 +395,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -362,8 +412,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentityComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentityComponent.cs new file mode 100644 index 000000000000..015df617e3a1 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsApiKey_DeleteViaIdentityComponent.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_DeleteViaIdentityComponent", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Delete an API Key of an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}", ApiVersion = "2015-05-01")] + public partial class RemoveAzApplicationInsightsApiKey_DeleteViaIdentityComponent : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _componentInputObject; + + /// 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 ComponentInputObject { get => this._componentInputObject; set => this._componentInputObject = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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 (ComponentInputObject?.Id != null) + { + this.ComponentInputObject.Id += $"/APIKeys/{(global::System.Uri.EscapeDataString(this.ApiKeyId.ToString()))}"; + await this.Client.ApiKeysDeleteViaIdentity(ComponentInputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ComponentInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + await this.Client.ApiKeysDelete(ComponentInputObject.SubscriptionId ?? null, ComponentInputObject.ResourceGroupName ?? null, ComponentInputObject.ResourceName ?? null, 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 { 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); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzApplicationInsightsApiKey_DeleteViaIdentityComponent() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey + /// 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.IApplicationInsightsComponentApiKey + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_Delete.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_Delete.cs index e85aa3701e99..57eb0a329a54 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_Delete.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete a Continuous Export configuration of an Application Insights component. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] public partial class RemoveAzApplicationInsightsContinuousExport_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsContinuousExport_Delete : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -68,6 +86,9 @@ public partial class RemoveAzApplicationInsightsContinuousExport_Delete : global [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; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -109,7 +130,7 @@ public partial class RemoveAzApplicationInsightsContinuousExport_Delete : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -155,7 +176,8 @@ public partial class RemoveAzApplicationInsightsContinuousExport_Delete : global [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -164,12 +186,12 @@ public partial class RemoveAzApplicationInsightsContinuousExport_Delete : global /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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); + 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) @@ -192,6 +214,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -256,8 +283,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -313,7 +365,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -326,12 +378,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.ExportConfigurationsDelete(ResourceGroupName, SubscriptionId, Name, ExportId, onOk, this, Pipeline); + await this.Client.ExportConfigurationsDelete(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,ExportId=ExportId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,7 +396,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsContinuousExport_Delete() { @@ -375,12 +427,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -392,8 +444,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity.cs index 30ea0e37c9cc..0375d7a5c4a1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete a Continuous Export configuration of an Application Insights component. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] public partial class RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsContinuousExport_DeleteViaIdenti /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsContinuousExport_DeleteViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -86,7 +107,7 @@ public partial class RemoveAzApplicationInsightsContinuousExport_DeleteViaIdenti /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -109,12 +130,12 @@ public partial class RemoveAzApplicationInsightsContinuousExport_DeleteViaIdenti /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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); + 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) @@ -137,6 +158,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,8 +227,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -258,7 +309,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -278,14 +329,14 @@ protected override void ProcessRecord() 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.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.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) ); @@ -294,13 +345,13 @@ protected override void ProcessRecord() { 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 this.Client.ExportConfigurationsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -313,7 +364,8 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet + /// class. /// public RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentity() { @@ -344,12 +396,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -361,8 +413,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentityComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentityComponent.cs new file mode 100644 index 000000000000..1e274655fa3a --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentityComponent.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.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_DeleteViaIdentityComponent", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] + public partial class RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentityComponent : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity _componentInputObject; + + /// 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 ComponentInputObject { get => this._componentInputObject; set => this._componentInputObject = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.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; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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 (ComponentInputObject?.Id != null) + { + this.ComponentInputObject.Id += $"/exportconfiguration/{(global::System.Uri.EscapeDataString(this.ExportId.ToString()))}"; + await this.Client.ExportConfigurationsDeleteViaIdentity(ComponentInputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ComponentInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + if (null == ComponentInputObject.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ComponentInputObject has null value for ComponentInputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ComponentInputObject) ); + } + await this.Client.ExportConfigurationsDelete(ComponentInputObject.SubscriptionId ?? null, ComponentInputObject.ResourceGroupName ?? null, ComponentInputObject.ResourceName ?? null, 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 { 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); + } + } + } + + /// + /// Initializes a new instance of the + /// cmdlet class. + /// + public RemoveAzApplicationInsightsContinuousExport_DeleteViaIdentityComponent() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + /// 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.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_Delete.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_Delete.cs index e48c057dff14..003b2b30c882 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_Delete.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete linked storage accounts for an Application Insights component. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] public partial class RemoveAzApplicationInsightsLinkedStorageAccount_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsLinkedStorageAccount_Delete : gl /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsLinkedStorageAccount_Delete : gl [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +121,7 @@ public partial class RemoveAzApplicationInsightsLinkedStorageAccount_Delete : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -146,7 +167,8 @@ public partial class RemoveAzApplicationInsightsLinkedStorageAccount_Delete : gl [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -155,12 +177,12 @@ public partial class RemoveAzApplicationInsightsLinkedStorageAccount_Delete : gl /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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); + 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 @@ -203,6 +225,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -267,8 +294,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -324,7 +376,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,12 +389,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.ComponentLinkedStorageAccountsDelete(ResourceGroupName, SubscriptionId, Name, onOk, onNoContent, onDefault, this, Pipeline); + await this.Client.ComponentLinkedStorageAccountsDelete(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,7 +407,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsLinkedStorageAccount_Delete() { @@ -388,12 +440,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,15 +462,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + 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 } }); @@ -443,7 +495,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -467,7 +519,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity.cs index cd29b9d08617..82916304a8f9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete linked storage accounts for an Application Insights component. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] public partial class RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaId /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaId [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaId /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -116,12 +137,12 @@ public partial class RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaId /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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); + 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 @@ -164,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -305,25 +356,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentLinkedStorageAccountsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public RemoveAzApplicationInsightsLinkedStorageAccount_DeleteViaIdentity() @@ -370,12 +421,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -392,7 +443,7 @@ protected override void StopProcessing() 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); + 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 } @@ -425,7 +476,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -449,7 +500,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsMyWorkbook_Delete.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsMyWorkbook_Delete.cs index 0f4565312d80..d3e4f72d818a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsMyWorkbook_Delete.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsMyWorkbook_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete a private workbook. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}", ApiVersion = "2021-03-08")] public partial class RemoveAzApplicationInsightsMyWorkbook_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsMyWorkbook_Delete : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsMyWorkbook_Delete : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -99,7 +120,7 @@ public partial class RemoveAzApplicationInsightsMyWorkbook_Delete : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -145,7 +166,8 @@ public partial class RemoveAzApplicationInsightsMyWorkbook_Delete : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -154,12 +176,12 @@ public partial class RemoveAzApplicationInsightsMyWorkbook_Delete : global::Syst /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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); + 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 @@ -202,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -266,8 +293,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -323,7 +375,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,7 +393,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,7 +406,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsMyWorkbook_Delete() { @@ -387,12 +439,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,15 +461,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 } }); @@ -442,7 +494,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -466,7 +518,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_Delete.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_Delete.cs index 094cc433605d..1f39628941e0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_Delete.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Deletes an Application Insights web test. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] public partial class RemoveAzApplicationInsightsWebTest_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsWebTest_Delete : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsWebTest_Delete : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +121,7 @@ public partial class RemoveAzApplicationInsightsWebTest_Delete : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -146,7 +167,8 @@ public partial class RemoveAzApplicationInsightsWebTest_Delete : global::System. [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -191,6 +213,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -255,8 +282,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -312,7 +364,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +382,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -343,7 +395,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsWebTest_Delete() { @@ -389,7 +441,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -413,7 +465,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_DeleteViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_DeleteViaIdentity.cs index e64edeb7dbe6..9e408f771e1c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_DeleteViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWebTest_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Deletes an Application Insights web test. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] public partial class RemoveAzApplicationInsightsWebTest_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsWebTest_DeleteViaIdentity : glob /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsWebTest_DeleteViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class RemoveAzApplicationInsightsWebTest_DeleteViaIdentity : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -152,6 +173,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -216,8 +242,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -273,7 +324,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -311,7 +362,7 @@ protected override void ProcessRecord() } 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 { }) + 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 } }); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsWebTest_DeleteViaIdentity() { @@ -370,7 +421,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -394,7 +445,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbookTemplate_Delete.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbookTemplate_Delete.cs index 840937e7c66e..b39949e67d48 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbookTemplate_Delete.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbookTemplate_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete a workbook template. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] public partial class RemoveAzApplicationInsightsWorkbookTemplate_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsWorkbookTemplate_Delete : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsWorkbookTemplate_Delete : global [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -99,7 +120,7 @@ public partial class RemoveAzApplicationInsightsWorkbookTemplate_Delete : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -145,7 +166,8 @@ public partial class RemoveAzApplicationInsightsWorkbookTemplate_Delete : global [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -154,12 +176,12 @@ public partial class RemoveAzApplicationInsightsWorkbookTemplate_Delete : global /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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); + 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 @@ -202,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -266,8 +293,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -323,7 +375,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,7 +393,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,7 +406,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsWorkbookTemplate_Delete() { @@ -387,12 +439,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,15 +461,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 } }); @@ -442,7 +494,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -466,7 +518,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdentity.cs index 102c513817a0..570a49524dc8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete a workbook template. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] public partial class RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdenti /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdenti /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -116,12 +137,12 @@ public partial class RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdenti /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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); + 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 @@ -164,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +374,7 @@ protected override void ProcessRecord() } 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 { }) + 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 } }); @@ -336,7 +387,8 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet + /// class. /// public RemoveAzApplicationInsightsWorkbookTemplate_DeleteViaIdentity() { @@ -369,12 +421,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,7 +443,7 @@ protected override void StopProcessing() 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); + 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 } @@ -424,7 +476,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -448,7 +500,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbook_Delete.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbook_Delete.cs index 48a787c2522f..b8b2115ad67e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbook_Delete.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbook_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete a workbook. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] public partial class RemoveAzApplicationInsightsWorkbook_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsWorkbook_Delete : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsWorkbook_Delete : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -99,7 +120,7 @@ public partial class RemoveAzApplicationInsightsWorkbook_Delete : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -145,7 +166,8 @@ public partial class RemoveAzApplicationInsightsWorkbook_Delete : global::System [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -154,12 +176,12 @@ public partial class RemoveAzApplicationInsightsWorkbook_Delete : global::System /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + 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 @@ -202,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -266,8 +293,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -323,7 +375,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,7 +393,7 @@ protected override void ProcessRecord() } 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,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,7 +406,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsWorkbook_Delete() { @@ -387,12 +439,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,15 +461,15 @@ protected override void StopProcessing() 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, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 } }); @@ -442,7 +494,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -466,7 +518,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity.cs index ff467d106d03..ba3a792fb1d3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Delete a workbook. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] public partial class RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity : glo /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity : glo [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -116,12 +137,12 @@ public partial class RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity : glo /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + 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 @@ -164,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +374,7 @@ protected override void ProcessRecord() } 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 { }) + 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 } }); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsightsWorkbook_DeleteViaIdentity() { @@ -369,12 +420,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,7 +442,7 @@ protected override void StopProcessing() 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); + 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 } @@ -424,7 +475,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -448,7 +499,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_Delete.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_Delete.cs index 481a70b56799..7883370ac652 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_Delete.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Deletes an Application Insights component. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class RemoveAzApplicationInsights_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsights_Delete : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsights_Delete : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +121,7 @@ public partial class RemoveAzApplicationInsights_Delete : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -146,7 +167,8 @@ public partial class RemoveAzApplicationInsights_Delete : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -155,12 +177,12 @@ public partial class RemoveAzApplicationInsights_Delete : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + 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 @@ -203,6 +225,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -267,8 +294,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -324,7 +376,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,12 +389,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.ComponentsDelete(ResourceGroupName, SubscriptionId, Name, onOk, onNoContent, onDefault, this, Pipeline); + await this.Client.ComponentsDelete(SubscriptionId, ResourceGroupName, 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,7 +407,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsights_Delete() { @@ -388,12 +440,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,15 +462,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name }) + 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 } }); @@ -443,7 +495,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -467,7 +519,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_DeleteViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_DeleteViaIdentity.cs index b85622614614..3e92e436289d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_DeleteViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/RemoveAzApplicationInsights_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// Deletes an Application Insights component. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class RemoveAzApplicationInsights_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzApplicationInsights_DeleteViaIdentity : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzApplicationInsights_DeleteViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class RemoveAzApplicationInsights_DeleteViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -116,12 +137,12 @@ public partial class RemoveAzApplicationInsights_DeleteViaIdentity : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + 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 @@ -164,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -305,25 +356,25 @@ protected override void ProcessRecord() 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.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.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 this.Client.ComponentsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? 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 { }) + 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 } }); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzApplicationInsights_DeleteViaIdentity() { @@ -369,12 +420,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,7 +442,7 @@ protected override void StopProcessing() 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); + 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 } @@ -424,7 +475,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -448,7 +499,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_Update.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_Update.cs index cf3ba0693b7c..c16c7e6923ab 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_Update.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_Update.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Update current billing features for an Application Insights component. + /// 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_Update", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update current billing features for an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures", ApiVersion = "2015-05-01")] public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Update : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +38,20 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures _billingFeaturesProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures _billingFeaturesProperty; /// An Application Insights component billing features [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "An Application Insights component billing features", ValueFromPipeline = true)] @@ -45,14 +60,18 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda ReadOnly = false, Description = @"An Application Insights component billing features", SerializedName = @"billingFeaturesProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures BillingFeaturesProperty { get => this._billingFeaturesProperty; set => this._billingFeaturesProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures BillingFeaturesProperty { get => this._billingFeaturesProperty; set => this._billingFeaturesProperty = 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -66,6 +85,9 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -107,7 +129,7 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -153,7 +175,8 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -162,12 +185,12 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures /// 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); + 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) @@ -190,6 +213,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -254,8 +282,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -311,7 +364,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,12 +377,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.ComponentCurrentBillingFeaturesUpdate(ResourceGroupName, SubscriptionId, Name, BillingFeaturesProperty, onOk, this, Pipeline); + await this.Client.ComponentCurrentBillingFeaturesUpdate(SubscriptionId, ResourceGroupName, Name, BillingFeaturesProperty, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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=BillingFeaturesProperty}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -342,7 +395,8 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet + /// class. /// public SetAzApplicationInsightsComponentCurrentBillingFeature_Update() { @@ -373,12 +427,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -390,8 +444,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs index b03da8f1ba8d..4abf23e97f9a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Update current billing features for an Application Insights component. + /// 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update current billing features for an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures", ApiVersion = "2015-05-01")] public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,18 +34,33 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures _billingFeaturesPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentBillingFeatures(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -59,7 +77,7 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda 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; } + public string[] CurrentBillingFeature { get => _billingFeaturesPropertiesBody.CurrentBillingFeature?.ToArray() ?? null /* fixedArrayOf */; set => _billingFeaturesPropertiesBody.CurrentBillingFeature = (value != null ? new System.Collections.Generic.List(value) : null); } /// Daily data volume cap in GB. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Daily data volume cap in GB.")] @@ -115,6 +133,9 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -156,7 +177,7 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -202,7 +223,8 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -211,12 +233,12 @@ public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_Upda /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures /// 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); + 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) @@ -239,6 +261,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -303,8 +330,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -360,7 +412,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -373,12 +425,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.ComponentCurrentBillingFeaturesUpdate(ResourceGroupName, SubscriptionId, Name, _billingFeaturesPropertiesBody, onOk, this, Pipeline); + await this.Client.ComponentCurrentBillingFeaturesUpdate(SubscriptionId, ResourceGroupName, Name, _billingFeaturesPropertiesBody, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -391,7 +443,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the + /// Initializes a new instance of the /// cmdlet class. /// public SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded() @@ -423,12 +475,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -440,8 +492,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..f8c0ef808ed9 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonFilePath.cs @@ -0,0 +1,472 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update current billing features for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentCurrentBillingFeaturesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonString.cs new file mode 100644 index 000000000000..edb7bfa4982e --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonString.cs @@ -0,0 +1,470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update current billing features for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentCurrentBillingFeaturesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public SetAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_Update.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_Update.cs index 36a01dccf7ba..dcb276cc080f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_Update.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_Update.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Update the Continuous Export configuration for this export id. + /// 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_Update", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update the Continuous Export configuration for this export id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] public partial class SetAzApplicationInsightsContinuousExport_Update : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class SetAzApplicationInsightsContinuousExport_Update : global::S /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -70,7 +88,7 @@ public partial class SetAzApplicationInsightsContinuousExport_Update : global::S public string ExportId { get => this._exportId; set => this._exportId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest _exportProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest _exportProperty; /// /// An Application Insights component Continuous Export configuration request definition. @@ -81,8 +99,12 @@ public partial class SetAzApplicationInsightsContinuousExport_Update : global::S ReadOnly = false, Description = @"An Application Insights component Continuous Export configuration request definition.", SerializedName = @"exportProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest ExportProperty { get => this._exportProperty; set => this._exportProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest ExportProperty { get => this._exportProperty; set => this._exportProperty = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// 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")] @@ -125,7 +147,7 @@ public partial class SetAzApplicationInsightsContinuousExport_Update : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -171,7 +193,8 @@ public partial class SetAzApplicationInsightsContinuousExport_Update : global::S [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -180,12 +203,12 @@ public partial class SetAzApplicationInsightsContinuousExport_Update : global::S /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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); + 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) @@ -208,6 +231,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -272,8 +300,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -329,7 +382,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -342,12 +395,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.ExportConfigurationsUpdate(ResourceGroupName, SubscriptionId, Name, ExportId, ExportProperty, onOk, this, Pipeline); + await this.Client.ExportConfigurationsUpdate(SubscriptionId, ResourceGroupName, Name, ExportId, ExportProperty, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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=ExportProperty}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,ExportId=ExportId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -360,7 +413,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public SetAzApplicationInsightsContinuousExport_Update() { @@ -391,12 +444,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,8 +461,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateExpanded.cs index 96fb18a4334f..e8af071b1ce3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Update the Continuous Export configuration for this export id. + /// 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update the Continuous Export configuration for this export id.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] public partial class SetAzApplicationInsightsContinuousExport_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,13 +41,28 @@ public partial class SetAzApplicationInsightsContinuousExport_UpdateExpanded : g /// /// 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest _exportPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentExportRequest(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -96,6 +114,9 @@ public partial class SetAzApplicationInsightsContinuousExport_UpdateExpanded : g [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; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -172,7 +193,7 @@ public partial class SetAzApplicationInsightsContinuousExport_UpdateExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -267,7 +288,8 @@ public partial class SetAzApplicationInsightsContinuousExport_UpdateExpanded : g [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -276,12 +298,12 @@ public partial class SetAzApplicationInsightsContinuousExport_UpdateExpanded : g /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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); + 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) @@ -304,6 +326,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -368,8 +395,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -425,7 +477,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -438,12 +490,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.ExportConfigurationsUpdate(ResourceGroupName, SubscriptionId, Name, ExportId, _exportPropertiesBody, onOk, this, Pipeline); + await this.Client.ExportConfigurationsUpdate(SubscriptionId, ResourceGroupName, Name, ExportId, _exportPropertiesBody, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,ExportId=ExportId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -456,7 +508,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public SetAzApplicationInsightsContinuousExport_UpdateExpanded() { @@ -487,12 +539,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -504,8 +556,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..a80d0f3dcb80 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateViaJsonFilePath.cs @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update the Continuous Export configuration for this export id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class SetAzApplicationInsightsContinuousExport_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.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; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ExportConfigurationsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, ExportId, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public SetAzApplicationInsightsContinuousExport_UpdateViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + /// 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.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateViaJsonString.cs new file mode 100644 index 000000000000..d7e2bf9cb518 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsightsContinuousExport_UpdateViaJsonString.cs @@ -0,0 +1,485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update the Continuous Export configuration for this export id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", ApiVersion = "2015-05-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class SetAzApplicationInsightsContinuousExport_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.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; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ExportConfigurationsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, ExportId, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public SetAzApplicationInsightsContinuousExport_UpdateViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration + /// 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.IApplicationInsightsComponentExportConfiguration + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_Update.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_Update.cs index 3a34dacc5258..d949e69347a7 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_Update.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_Update.cs @@ -6,10 +6,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// update (or update an Application Insights component. Note: You cannot specify a different value for InstrumentationKey /// nor AppId in the Put operation. /// /// @@ -17,12 +19,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"AzApplicationInsights_Update", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update (or update 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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class SetAzApplicationInsights_Update : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,11 +41,26 @@ public partial class SetAzApplicationInsights_Update : global::System.Management /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -56,6 +74,9 @@ public partial class SetAzApplicationInsights_Update : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -69,7 +90,7 @@ public partial class SetAzApplicationInsights_Update : global::System.Management public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent _insightProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent _insightProperty; /// An Application Insights component definition. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "An Application Insights component definition.", ValueFromPipeline = true)] @@ -78,8 +99,9 @@ public partial class SetAzApplicationInsights_Update : global::System.Management ReadOnly = false, Description = @"An Application Insights component definition.", SerializedName = @"insightProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent InsightProperty { get => this._insightProperty; set => this._insightProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent InsightProperty { get => this._insightProperty; set => this._insightProperty = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -110,7 +132,7 @@ public partial class SetAzApplicationInsights_Update : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -156,7 +178,8 @@ public partial class SetAzApplicationInsights_Update : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -165,24 +188,24 @@ public partial class SetAzApplicationInsights_Update : global::System.Management /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -205,6 +228,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -269,8 +297,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -326,7 +379,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -339,12 +392,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.ComponentsCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, InsightProperty, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, InsightProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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=InsightProperty}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -357,7 +410,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public SetAzApplicationInsights_Update() { @@ -390,12 +443,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,15 +465,15 @@ protected override void StopProcessing() 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=InsightProperty }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=InsightProperty }) + 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 } }); @@ -430,12 +483,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -447,8 +500,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateExpanded.cs index f50f75aeee58..9e4829ec84ad 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateExpanded.cs @@ -6,10 +6,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey + /// update (or update an Application Insights component. Note: You cannot specify a different value for InstrumentationKey /// nor AppId in the Put operation. /// /// @@ -17,12 +19,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets /// [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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update (or update 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] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,8 +41,20 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// An Application Insights component definition. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent _insightPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponent(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent _insightPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponent(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Type of application being monitored. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of application being monitored.")] @@ -49,15 +64,18 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] + public string ApplicationType { get => _insightPropertiesBody.ApplicationType ?? null; 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -104,6 +122,9 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma PossibleTypes = new [] { typeof(string) })] public string Etag { get => _insightPropertiesBody.Etag ?? null; set => _insightPropertiesBody.Etag = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// /// 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. @@ -115,9 +136,9 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] + public string FlowType { get => _insightPropertiesBody.FlowType ?? null; 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.")] @@ -132,13 +153,14 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma /// /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + /// Please visit external url https://aka.ms/ewjuel to get more information. /// - [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::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. Please visit external url https://aka.ms/ewjuel to get more information.")] [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.", + Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. Please visit external url https://aka.ms/ewjuel to get more information.", SerializedName = @"HockeyAppId", PossibleTypes = new [] { typeof(string) })] public string HockeyAppId { get => _insightPropertiesBody.HockeyAppId ?? null; set => _insightPropertiesBody.HockeyAppId = value; } @@ -174,9 +196,9 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] + public string IngestionMode { get => _insightPropertiesBody.IngestionMode ?? null; 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; } } @@ -232,7 +254,7 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -258,9 +280,9 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccessForIngestion { get => _insightPropertiesBody.PublicNetworkAccessForIngestion ?? null; 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.")] @@ -270,9 +292,9 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string PublicNetworkAccessForQuery { get => _insightPropertiesBody.PublicNetworkAccessForQuery ?? null; set => _insightPropertiesBody.PublicNetworkAccessForQuery = value; } /// /// Describes what tool created this Application Insights component. Customers using this API should set this to the default @@ -285,9 +307,9 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] + public string RequestSource { get => _insightPropertiesBody.RequestSource ?? null; set => _insightPropertiesBody.RequestSource = value; } /// Backing field for property. private string _resourceGroupName; @@ -316,13 +338,14 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma /// /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + /// Please visit external url https://aka.ms/sl0yqd to get more information. /// - [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::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. Please visit external url https://aka.ms/sl0yqd to get more information.")] [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.", + Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. Please visit external url https://aka.ms/sl0yqd to get more information.", SerializedName = @"SamplingPercentage", PossibleTypes = new [] { typeof(double) })] public double SamplingPercentage { get => _insightPropertiesBody.SamplingPercentage ?? default(double); set => _insightPropertiesBody.SamplingPercentage = value; } @@ -341,7 +364,8 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -354,8 +378,8 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma 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; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 @@ -376,24 +400,24 @@ public partial class SetAzApplicationInsights_UpdateExpanded : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -416,6 +440,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -480,8 +509,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -537,7 +591,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -550,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.ComponentsCreateOrUpdate(ResourceGroupName, SubscriptionId, Name, _insightPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _insightPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate); 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -568,7 +622,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public SetAzApplicationInsights_UpdateExpanded() { @@ -601,12 +655,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -623,15 +677,15 @@ protected override void StopProcessing() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_insightPropertiesBody }) + 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 } }); @@ -641,12 +695,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -658,8 +712,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..f3d523d57272 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateViaJsonFilePath.cs @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// + /// update (or update 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_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update (or update 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class SetAzApplicationInsights_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public SetAzApplicationInsights_UpdateViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateViaJsonString.cs new file mode 100644 index 000000000000..6442cbb99e37 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/SetAzApplicationInsights_UpdateViaJsonString.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// + /// update (or update 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_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update (or update 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class SetAzApplicationInsights_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public SetAzApplicationInsights_UpdateViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_Update.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_Update.cs new file mode 100644 index 000000000000..2e2d4e405090 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_Update.cs @@ -0,0 +1,480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update current billing features for an Application Insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures" + /// [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.VerbsData.Update, @"AzApplicationInsightsComponentCurrentBillingFeature_Update", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 UpdateAzApplicationInsightsComponentCurrentBillingFeature_Update : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures _billingFeaturesProperty; + + /// An Application Insights component billing features + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "An Application Insights component billing features", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"An Application Insights component billing features", + SerializedName = @"billingFeaturesProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures BillingFeaturesProperty { get => this._billingFeaturesProperty; set => this._billingFeaturesProperty = 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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; } + BillingFeaturesProperty = await this.Client.ComponentCurrentBillingFeaturesGetWithResult(SubscriptionId, ResourceGroupName, Name, this, Pipeline); + this.UpdateBillingFeaturesProperty(); + await this.Client.ComponentCurrentBillingFeaturesUpdate(SubscriptionId, ResourceGroupName, Name, BillingFeaturesProperty, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); + 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzApplicationInsightsComponentCurrentBillingFeature_Update() + { + + } + + private void UpdateBillingFeaturesProperty() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("BillingFeaturesProperty"))) + { + this.BillingFeaturesProperty = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures)(this.MyInvocation?.BoundParameters["BillingFeaturesProperty"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs new file mode 100644 index 000000000000..d2f02931add4 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded.cs @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update current billing features for an Application Insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures" + /// [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.VerbsData.Update, @"AzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// An Application Insights component billing features + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures _billingFeaturesPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentBillingFeatures(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.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?.ToArray() ?? null /* fixedArrayOf */; set => _billingFeaturesPropertiesBody.CurrentBillingFeature = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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; } + _billingFeaturesPropertiesBody = await this.Client.ComponentCurrentBillingFeaturesGetWithResult(SubscriptionId, ResourceGroupName, Name, this, Pipeline); + this.Update_billingFeaturesPropertiesBody(); + await this.Client.ComponentCurrentBillingFeaturesUpdate(SubscriptionId, ResourceGroupName, Name, _billingFeaturesPropertiesBody, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); + 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded() + { + + } + + private void Update_billingFeaturesPropertiesBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CurrentBillingFeature"))) + { + this.CurrentBillingFeature = (string[])(this.MyInvocation?.BoundParameters["CurrentBillingFeature"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataVolumeCap"))) + { + this.DataVolumeCap = (float)(this.MyInvocation?.BoundParameters["DataVolumeCap"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataVolumeCapWarningThreshold"))) + { + this.DataVolumeCapWarningThreshold = (int)(this.MyInvocation?.BoundParameters["DataVolumeCapWarningThreshold"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataVolumeCapStopSendNotificationWhenHitThreshold"))) + { + this.DataVolumeCapStopSendNotificationWhenHitThreshold = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["DataVolumeCapStopSendNotificationWhenHitThreshold"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataVolumeCapStopSendNotificationWhenHitCap"))) + { + this.DataVolumeCapStopSendNotificationWhenHitCap = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["DataVolumeCapStopSendNotificationWhenHitCap"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentity.cs new file mode 100644 index 000000000000..12ba5f9052b0 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentity.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update current billing features for an Application Insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures" + /// [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.VerbsData.Update, @"AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures _billingFeaturesProperty; + + /// An Application Insights component billing features + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "An Application Insights component billing features", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"An Application Insights component billing features", + SerializedName = @"billingFeaturesProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures BillingFeaturesProperty { get => this._billingFeaturesProperty; set => this._billingFeaturesProperty = 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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) + { + BillingFeaturesProperty = await this.Client.ComponentCurrentBillingFeaturesGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.UpdateBillingFeaturesProperty(); + await this.Client.ComponentCurrentBillingFeaturesUpdateViaIdentity(InputObject.Id, BillingFeaturesProperty, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + 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.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.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) ); + } + BillingFeaturesProperty = await this.Client.ComponentCurrentBillingFeaturesGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, this, Pipeline); + this.UpdateBillingFeaturesProperty(); + await this.Client.ComponentCurrentBillingFeaturesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, BillingFeaturesProperty, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); + } + 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(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentity() + { + + } + + private void UpdateBillingFeaturesProperty() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("BillingFeaturesProperty"))) + { + this.BillingFeaturesProperty = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures)(this.MyInvocation?.BoundParameters["BillingFeaturesProperty"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..3f1b30130540 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentityExpanded.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update current billing features for an Application Insights component. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures" + /// [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.VerbsData.Update, @"AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// An Application Insights component billing features + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures _billingFeaturesPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ApplicationInsightsComponentBillingFeatures(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.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?.ToArray() ?? null /* fixedArrayOf */; set => _billingFeaturesPropertiesBody.CurrentBillingFeature = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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. + /// + public 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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) + { + _billingFeaturesPropertiesBody = await this.Client.ComponentCurrentBillingFeaturesGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_billingFeaturesPropertiesBody(); + await this.Client.ComponentCurrentBillingFeaturesUpdateViaIdentity(InputObject.Id, _billingFeaturesPropertiesBody, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + 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.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.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) ); + } + _billingFeaturesPropertiesBody = await this.Client.ComponentCurrentBillingFeaturesGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, this, Pipeline); + this.Update_billingFeaturesPropertiesBody(); + await this.Client.ComponentCurrentBillingFeaturesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _billingFeaturesPropertiesBody, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); + } + 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(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentityExpanded() + { + + } + + private void Update_billingFeaturesPropertiesBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CurrentBillingFeature"))) + { + this.CurrentBillingFeature = (string[])(this.MyInvocation?.BoundParameters["CurrentBillingFeature"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataVolumeCap"))) + { + this.DataVolumeCap = (float)(this.MyInvocation?.BoundParameters["DataVolumeCap"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataVolumeCapWarningThreshold"))) + { + this.DataVolumeCapWarningThreshold = (int)(this.MyInvocation?.BoundParameters["DataVolumeCapWarningThreshold"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataVolumeCapStopSendNotificationWhenHitThreshold"))) + { + this.DataVolumeCapStopSendNotificationWhenHitThreshold = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["DataVolumeCapStopSendNotificationWhenHitThreshold"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DataVolumeCapStopSendNotificationWhenHitCap"))) + { + this.DataVolumeCapStopSendNotificationWhenHitCap = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["DataVolumeCapStopSendNotificationWhenHitCap"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures + /// 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.IApplicationInsightsComponentBillingFeatures + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_Update.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_Update.cs index 2cb310e17066..a655c83e5ce9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_Update.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_Update.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + /// update 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_Update", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update an existing component's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class UpdateAzApplicationInsightsComponentTag_Update : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,16 +40,31 @@ public partial class UpdateAzApplicationInsightsComponentTag_Update : global::Sy /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource _componentTag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource _componentTag; /// /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. @@ -57,8 +75,9 @@ public partial class UpdateAzApplicationInsightsComponentTag_Update : global::Sy ReadOnly = false, Description = @"A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance.", SerializedName = @"componentTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource ComponentTag { get => this._componentTag; set => this._componentTag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource ComponentTag { get => this._componentTag; set => this._componentTag = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -70,6 +89,9 @@ public partial class UpdateAzApplicationInsightsComponentTag_Update : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -111,7 +133,7 @@ public partial class UpdateAzApplicationInsightsComponentTag_Update : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -157,7 +179,8 @@ public partial class UpdateAzApplicationInsightsComponentTag_Update : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -166,24 +189,24 @@ public partial class UpdateAzApplicationInsightsComponentTag_Update : global::Sy /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -206,6 +229,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -270,8 +298,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -327,7 +380,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -340,12 +393,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.ComponentsUpdateTags(ResourceGroupName, SubscriptionId, Name, ComponentTag, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsUpdateTags(SubscriptionId, ResourceGroupName, Name, ComponentTag, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); 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=ComponentTag}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -365,7 +418,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzApplicationInsightsComponentTag_Update() { @@ -391,12 +444,12 @@ public UpdateAzApplicationInsightsComponentTag_Update() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -413,15 +466,15 @@ public UpdateAzApplicationInsightsComponentTag_Update() 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=ComponentTag }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=ComponentTag }) + 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 } }); @@ -431,12 +484,12 @@ public UpdateAzApplicationInsightsComponentTag_Update() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -448,8 +501,26 @@ public UpdateAzApplicationInsightsComponentTag_Update() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateExpanded.cs index d456a2ec57d1..7dc37e6de89e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + /// update 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update an existing component's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class UpdateAzApplicationInsightsComponentTag_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,13 +43,28 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateExpanded : gl /// /// 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.Api202002.ITagsResource _componentTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource _componentTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TagsResource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateExpanded : gl [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -101,7 +122,7 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateExpanded : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -147,7 +168,8 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateExpanded : gl [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -160,32 +182,32 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateExpanded : gl ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags Tag { get => _componentTagsBody.Tag ?? null /* object */; set => _componentTagsBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -208,6 +230,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -272,8 +299,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -329,7 +381,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -342,12 +394,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.ComponentsUpdateTags(ResourceGroupName, SubscriptionId, Name, _componentTagsBody, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsUpdateTags(SubscriptionId, ResourceGroupName, Name, _componentTagsBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -367,7 +419,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzApplicationInsightsComponentTag_UpdateExpanded() { @@ -393,12 +445,12 @@ 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -415,15 +467,15 @@ public UpdateAzApplicationInsightsComponentTag_UpdateExpanded() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_componentTagsBody }) + 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 } }); @@ -433,12 +485,12 @@ public UpdateAzApplicationInsightsComponentTag_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -450,8 +502,26 @@ public UpdateAzApplicationInsightsComponentTag_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity.cs index e68f7b5a1406..f9a97c017b64 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + /// update 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_UpdateViaIdentity", 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update an existing component's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,16 +40,31 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity : /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource _componentTag; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource _componentTag; /// /// A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. @@ -57,8 +75,9 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity : ReadOnly = false, Description = @"A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance.", SerializedName = @"componentTags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource ComponentTag { get => this._componentTag; set => this._componentTag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource ComponentTag { get => this._componentTag; set => this._componentTag = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -70,6 +89,9 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -104,7 +126,7 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -127,24 +149,24 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -167,6 +189,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -231,8 +258,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -288,7 +340,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -303,30 +355,30 @@ 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.ComponentsUpdateTagsViaIdentity(InputObject.Id, ComponentTag, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsUpdateTagsViaIdentity(InputObject.Id, ComponentTag, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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.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.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, ComponentTag, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsUpdateTags(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, ComponentTag, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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=ComponentTag}) + 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 } }); @@ -346,7 +398,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity() { @@ -372,12 +424,12 @@ public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -394,15 +446,15 @@ public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity() 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=ComponentTag }) + 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 { body=ComponentTag }) + 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 } }); @@ -412,12 +464,12 @@ public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -429,8 +481,26 @@ public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentity() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded.cs index 1c5e5c8afb56..67b7f366b4d1 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; /// - /// Updates an existing component's tags. To update other fields use the CreateOrUpdate method. + /// update 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update an existing component's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,13 +43,28 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityEx /// /// 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.Api202002.ITagsResource _componentTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource _componentTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TagsResource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityEx [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +115,7 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityEx /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -121,32 +142,32 @@ public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityEx ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags Tag { get => _componentTagsBody.Tag ?? null /* object */; set => _componentTagsBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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); + 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) @@ -169,6 +190,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -233,8 +259,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -290,7 +341,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -305,30 +356,30 @@ 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.ComponentsUpdateTagsViaIdentity(InputObject.Id, _componentTagsBody, onOk, onDefault, this, Pipeline); + await this.Client.ComponentsUpdateTagsViaIdentity(InputObject.Id, _componentTagsBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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.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.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 this.Client.ComponentsUpdateTags(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _componentTagsBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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}) + 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 } }); @@ -348,7 +399,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded() @@ -375,12 +426,12 @@ 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -397,15 +448,15 @@ public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded() 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 }) + 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 { body=_componentTagsBody }) + 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 } }); @@ -415,12 +466,12 @@ public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -432,8 +483,26 @@ public UpdateAzApplicationInsightsComponentTag_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..2b154eeab9f4 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaJsonFilePath.cs @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// + /// update 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_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update an existing component's tags. To update other fields use the CreateOrupdate method.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentsUpdateTagsViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzApplicationInsightsComponentTag_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaJsonString.cs new file mode 100644 index 000000000000..4b9d1aefd60f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsComponentTag_UpdateViaJsonString.cs @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// + /// update 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_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update an existing component's tags. To update other fields use the CreateOrupdate method.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", ApiVersion = "2020-02-02")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsComponentTag_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentsUpdateTagsViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsComponentTag_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent + /// 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.IApplicationInsightsComponent + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded.cs index f0d5ed262a9b..77c1032edc8f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Update linked storage accounts for an Application Insights component. + /// 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update linked storage accounts for an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,14 +37,29 @@ public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpan /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch _linkedStorageAccountsPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccountsPatch(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpan [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -107,7 +128,7 @@ public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -153,7 +174,8 @@ public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpan [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -162,24 +184,24 @@ public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpan /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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); + 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) @@ -202,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -266,8 +293,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -323,7 +375,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,12 +388,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.ComponentLinkedStorageAccountsUpdate(ResourceGroupName, SubscriptionId, Name, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.ComponentLinkedStorageAccountsUpdate(SubscriptionId, ResourceGroupName, Name, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); 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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -361,7 +413,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded() @@ -388,12 +440,12 @@ 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,15 +462,15 @@ public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded() 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 }) + 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 { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId, Name=Name, body=_linkedStorageAccountsPropertiesBody }) + 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 } }); @@ -428,12 +480,12 @@ public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -445,8 +497,26 @@ public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded.cs index 6d24f84ac6d0..405fe66f9ea3 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Update linked storage accounts for an Application Insights component. + /// 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::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update linked storage accounts for an Application Insights component.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,14 +37,29 @@ public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaId /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// 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(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch _linkedStorageAccountsPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ComponentLinkedStorageAccountsPatch(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaId [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +121,7 @@ public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaId /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -123,24 +144,24 @@ public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaId /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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); + 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) @@ -163,6 +184,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -227,8 +253,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -284,7 +335,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,30 +350,30 @@ 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.ComponentLinkedStorageAccountsUpdateViaIdentity(InputObject.Id, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.ComponentLinkedStorageAccountsUpdateViaIdentity(InputObject.Id, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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.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.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 this.Client.ComponentLinkedStorageAccountsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _linkedStorageAccountsPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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}) + 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 } }); @@ -342,7 +393,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. /// public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded() @@ -369,12 +420,12 @@ 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,15 +442,15 @@ public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded 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 }) + 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 { body=_linkedStorageAccountsPropertiesBody }) + 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 } }); @@ -409,12 +460,12 @@ public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -426,8 +477,26 @@ public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaIdentityExpanded return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..6d6d578af067 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonFilePath.cs @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update linked storage accounts for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentLinkedStorageAccountsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the + /// cmdlet class. + /// + public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + /// 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.IComponentLinkedStorageAccounts + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonString.cs new file mode 100644 index 000000000000..2a2852ee0a86 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonString.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + 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_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update linked storage accounts for an Application Insights component.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}", ApiVersion = "2020-03-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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, this.ExtensibleParameters); + 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.ComponentLinkedStorageAccountsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzApplicationInsightsLinkedStorageAccount_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts + /// 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.IComponentLinkedStorageAccounts + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsMyWorkbook_Update.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsMyWorkbook_Update.cs index 42edc03745a6..c5f6b6e3161e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsMyWorkbook_Update.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsMyWorkbook_Update.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Updates a private workbook that has already been added. + /// update a new private workbook. /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsMyWorkbook_Update", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The types of the properties PropertiesTag will be changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Updates a private workbook that has already been added.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update a new private workbook.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/myWorkbooks/{resourceName}", ApiVersion = "2021-03-08")] public partial class UpdateAzApplicationInsightsMyWorkbook_Update : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class UpdateAzApplicationInsightsMyWorkbook_Update : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class UpdateAzApplicationInsightsMyWorkbook_Update : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -107,7 +127,7 @@ public partial class UpdateAzApplicationInsightsMyWorkbook_Update : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -153,12 +173,13 @@ public partial class UpdateAzApplicationInsightsMyWorkbook_Update : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook _workbookProperty; + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook _workbookProperty; /// An Application Insights private workbook definition. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "An Application Insights private workbook definition.", ValueFromPipeline = true)] @@ -167,44 +188,45 @@ public partial class UpdateAzApplicationInsightsMyWorkbook_Update : global::Syst ReadOnly = false, Description = @"An Application Insights private workbook definition.", SerializedName = @"workbookProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook WorkbookProperty { get => this._workbookProperty; set => this._workbookProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook WorkbookProperty { get => this._workbookProperty; set => this._workbookProperty = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// 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); + 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) @@ -227,6 +249,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -291,8 +318,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -309,7 +361,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'MyWorkbooksUpdate' operation")) + if (ShouldProcess($"Call remote 'MyWorkbooksCreateOrUpdate' operation")) { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener)this).Token) ) { @@ -348,7 +400,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -361,12 +413,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.MyWorkbooksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, WorkbookProperty, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.MyWorkbooksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, WorkbookProperty, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null,body=WorkbookProperty}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -386,7 +438,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzApplicationInsightsMyWorkbook_Update() { @@ -410,12 +462,12 @@ public UpdateAzApplicationInsightsMyWorkbook_Update() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -427,8 +479,26 @@ public UpdateAzApplicationInsightsMyWorkbook_Update() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -436,12 +506,12 @@ public UpdateAzApplicationInsightsMyWorkbook_Update() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -458,15 +528,15 @@ public UpdateAzApplicationInsightsMyWorkbook_Update() 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, ResourceGroupName=ResourceGroupName, Name=Name, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=WorkbookProperty }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=WorkbookProperty }) + 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 } }); @@ -476,12 +546,12 @@ public UpdateAzApplicationInsightsMyWorkbook_Update() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -493,8 +563,26 @@ public UpdateAzApplicationInsightsMyWorkbook_Update() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateExpanded.cs index 992b2c0e2a4a..5407364e6018 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Updates the tags associated with an Application Insights web test. + /// update the tags associated with an Application Insights web test. /// /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWebTestTag_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Updates the tags associated with an Application Insights web test.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update the tags associated with an Application Insights web test.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,16 +37,31 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : glob /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// 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.Api202002.ITagsResource _webTestTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource _webTestTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -57,6 +75,9 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : glob [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -97,7 +118,7 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -143,7 +164,8 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : glob [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -156,20 +178,20 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateExpanded : glob ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags Tag { get => _webTestTagsBody.Tag ?? null /* object */; set => _webTestTagsBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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); + 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) @@ -192,6 +214,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -256,8 +283,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -313,7 +365,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -326,12 +378,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(SubscriptionId, ResourceGroupName, Name, _webTestTagsBody, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -351,7 +403,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzApplicationInsightsWebTestTag_UpdateExpanded() { @@ -375,12 +427,12 @@ public UpdateAzApplicationInsightsWebTestTag_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -392,8 +444,26 @@ public UpdateAzApplicationInsightsWebTestTag_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded.cs index 36c45f11d5e8..60081282401b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Updates the tags associated with an Application Insights web test. + /// update the tags associated with an Application Insights web test. /// /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Updates the tags associated with an Application Insights web test.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update the tags associated with an Application Insights web test.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,16 +37,31 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// 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.Api202002.ITagsResource _webTestTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.TagsResource(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource _webTestTagsBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -57,6 +75,9 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpa [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -91,7 +112,7 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -118,20 +139,20 @@ public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpa ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags Tag { get => _webTestTagsBody.Tag ?? null /* object */; set => _webTestTagsBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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 /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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); + 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) @@ -154,6 +175,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -218,8 +244,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -290,30 +341,30 @@ 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, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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.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.WebTestName) { 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.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WebTestName ?? null, _webTestTagsBody, onOk, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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 { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -333,7 +384,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded() @@ -358,12 +409,12 @@ public UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -375,8 +426,26 @@ public UpdateAzApplicationInsightsWebTestTag_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..11e8ab43ab1b --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonFilePath.cs @@ -0,0 +1,469 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update the tags associated with an Application Insights web test. + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWebTestTag_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update the tags associated with an Application Insights web test.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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::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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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 'WebTestsUpdateTags' 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, this.ExtensibleParameters); + 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.WebTestsUpdateTagsViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + /// 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.IWebTest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonString.cs new file mode 100644 index 000000000000..77519ea68b53 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonString.cs @@ -0,0 +1,467 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update the tags associated with an Application Insights web test. + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWebTestTag_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update the tags associated with an Application Insights web test.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", ApiVersion = "2022-06-15")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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::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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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 'WebTestsUpdateTags' 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, this.ExtensibleParameters); + 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.WebTestsUpdateTagsViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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 { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsWebTestTag_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest + /// 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.IWebTest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded.cs index f5c3951652db..20594c888624 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Updates a workbook template that has already been added. + /// update a workbook template that has already been added. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWorkbookTemplate_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Gallery"}, NewOutputProperties=new string[] {"Gallery"}, ChangeDescription="The type of property 'Gallery' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Updates a workbook template that has already been added.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update a workbook template that has already been added.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,20 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// The parameters that can be provided when updating workbook template. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters _workbookTemplateUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateUpdateParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters _workbookTemplateUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateUpdateParameters(); /// Information about the author of the workbook template. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the author of the workbook template.")] @@ -54,6 +68,9 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -67,6 +84,9 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Workbook galleries supported by the template. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Workbook galleries supported by the template.")] @@ -76,8 +96,8 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded ReadOnly = false, Description = @"Workbook galleries supported by the template.", SerializedName = @"galleries", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get => _workbookTemplateUpdateParametersBody.Gallery ?? null /* arrayOf */; set => _workbookTemplateUpdateParametersBody.Gallery = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery[] Gallery { get => _workbookTemplateUpdateParametersBody.Gallery?.ToArray() ?? null /* fixedArrayOf */; set => _workbookTemplateUpdateParametersBody.Gallery = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -105,8 +125,8 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded ReadOnly = false, Description = @"Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.", SerializedName = @"localized", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get => _workbookTemplateUpdateParametersBody.Localized ?? null /* object */; set => _workbookTemplateUpdateParametersBody.Localized = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get => _workbookTemplateUpdateParametersBody.Localized ?? null /* object */; set => _workbookTemplateUpdateParametersBody.Localized = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -133,7 +153,7 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. @@ -192,7 +212,8 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -205,8 +226,8 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags Tag { get => _workbookTemplateUpdateParametersBody.Tag ?? null /* object */; set => _workbookTemplateUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags Tag { get => _workbookTemplateUpdateParametersBody.Tag ?? null /* object */; set => _workbookTemplateUpdateParametersBody.Tag = value; } /// Valid JSON object containing workbook template payload. [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -217,32 +238,32 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded ReadOnly = false, Description = @"Valid JSON object containing workbook template payload.", SerializedName = @"templateData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get => _workbookTemplateUpdateParametersBody.TemplateData ?? null /* object */; set => _workbookTemplateUpdateParametersBody.TemplateData = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get => _workbookTemplateUpdateParametersBody.TemplateData ?? null /* object */; set => _workbookTemplateUpdateParametersBody.TemplateData = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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); + 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) @@ -265,6 +286,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -329,8 +355,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -386,7 +437,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -399,12 +450,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.WorkbookTemplatesUpdate(SubscriptionId, ResourceGroupName, Name, _workbookTemplateUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkbookTemplatesUpdate(SubscriptionId, ResourceGroupName, Name, _workbookTemplateUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); 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,ResourceGroupName=ResourceGroupName,Name=Name,body=_workbookTemplateUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -424,7 +475,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded() { @@ -450,12 +501,12 @@ public UpdateAzApplicationInsightsWorkbookTemplate_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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -472,15 +523,15 @@ public UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded() 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, ResourceGroupName=ResourceGroupName, Name=Name, body=_workbookTemplateUpdateParametersBody }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_workbookTemplateUpdateParametersBody }) + 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 } }); @@ -490,12 +541,12 @@ public UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -507,8 +558,26 @@ public UpdateAzApplicationInsightsWorkbookTemplate_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded.cs index e153293a2678..fe71f90280de 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Updates a workbook template that has already been added. + /// update a workbook template that has already been added. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Gallery"}, NewOutputProperties=new string[] {"Gallery"}, ChangeDescription="The type of property 'Gallery' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Updates a workbook template that has already been added.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update a workbook template that has already been added.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,20 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdenti /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// The parameters that can be provided when updating workbook template. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParameters _workbookTemplateUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.WorkbookTemplateUpdateParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParameters _workbookTemplateUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookTemplateUpdateParameters(); /// Information about the author of the workbook template. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Information about the author of the workbook template.")] @@ -54,6 +68,9 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; @@ -67,6 +84,9 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Workbook galleries supported by the template. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Workbook galleries supported by the template.")] @@ -76,8 +96,8 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdenti ReadOnly = false, Description = @"Workbook galleries supported by the template.", SerializedName = @"galleries", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGallery[] Gallery { get => _workbookTemplateUpdateParametersBody.Gallery ?? null /* arrayOf */; set => _workbookTemplateUpdateParametersBody.Gallery = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGallery[] Gallery { get => _workbookTemplateUpdateParametersBody.Gallery?.ToArray() ?? null /* fixedArrayOf */; set => _workbookTemplateUpdateParametersBody.Gallery = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -113,8 +133,8 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdenti ReadOnly = false, Description = @"Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.", SerializedName = @"localized", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesLocalized Localized { get => _workbookTemplateUpdateParametersBody.Localized ?? null /* object */; set => _workbookTemplateUpdateParametersBody.Localized = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesLocalized Localized { get => _workbookTemplateUpdateParametersBody.Localized ?? null /* object */; set => _workbookTemplateUpdateParametersBody.Localized = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -127,7 +147,7 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdenti /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } /// /// Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. @@ -167,8 +187,8 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdenti ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags Tag { get => _workbookTemplateUpdateParametersBody.Tag ?? null /* object */; set => _workbookTemplateUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags Tag { get => _workbookTemplateUpdateParametersBody.Tag ?? null /* object */; set => _workbookTemplateUpdateParametersBody.Tag = value; } /// Valid JSON object containing workbook template payload. [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -179,32 +199,32 @@ public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdenti ReadOnly = false, Description = @"Valid JSON object containing workbook template payload.", SerializedName = @"templateData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get => _workbookTemplateUpdateParametersBody.TemplateData ?? null /* object */; set => _workbookTemplateUpdateParametersBody.TemplateData = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get => _workbookTemplateUpdateParametersBody.TemplateData ?? null /* object */; set => _workbookTemplateUpdateParametersBody.TemplateData = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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); + 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) @@ -227,6 +247,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -291,8 +316,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -348,7 +398,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -363,7 +413,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.WorkbookTemplatesUpdateViaIdentity(InputObject.Id, _workbookTemplateUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkbookTemplatesUpdateViaIdentity(InputObject.Id, _workbookTemplateUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } else { @@ -380,13 +430,13 @@ protected override void ProcessRecord() { 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.WorkbookTemplatesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _workbookTemplateUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkbookTemplatesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _workbookTemplateUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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=_workbookTemplateUpdateParametersBody}) + 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 } }); @@ -406,7 +456,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the + /// Initializes a new instance of the /// cmdlet class. /// public UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded() @@ -433,12 +483,12 @@ public UpdateAzApplicationInsightsWorkbookTemplate_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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -455,15 +505,15 @@ public UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded() 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=_workbookTemplateUpdateParametersBody }) + 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 { body=_workbookTemplateUpdateParametersBody }) + 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 } }); @@ -473,12 +523,12 @@ public UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -490,8 +540,26 @@ public UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..3269f48cb754 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonFilePath.cs @@ -0,0 +1,524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update a workbook template that has already been added. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWorkbookTemplate_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update a workbook template that has already been added.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = 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::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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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 'WorkbookTemplatesUpdate' 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, this.ExtensibleParameters); + 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.WorkbookTemplatesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// 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.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonString.cs new file mode 100644 index 000000000000..36495d5c3824 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonString.cs @@ -0,0 +1,522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update a workbook template that has already been added. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWorkbookTemplate_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update a workbook template that has already been added.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}", ApiVersion = "2020-11-20")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = 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::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. + /// + public 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", + SetCondition = @"")] + [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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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 'WorkbookTemplatesUpdate' 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, this.ExtensibleParameters); + 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.WorkbookTemplatesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, 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,ResourceGroupName=ResourceGroupName,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(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzApplicationInsightsWorkbookTemplate_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplate + /// 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.IWorkbookTemplate + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateExpanded.cs index ffaa2d3e861d..5d435e3ef05c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Updates a workbook that has already been added. + /// update a workbook that has already been added. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWorkbook_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Updates a workbook that has already been added.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update a workbook that has already been added.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] public partial class UpdateAzApplicationInsightsWorkbook_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,16 +37,31 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateExpanded : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// The parameters that can be provided when updating workbook properties properties. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters _workbookUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters _workbookUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParameters(); /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Workbook category, as defined by the user at creation time. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Workbook category, as defined by the user at creation time.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] @@ -91,6 +108,9 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateExpanded : global PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workbookUpdateParametersBody.DisplayName ?? null; set => _workbookUpdateParametersBody.DisplayName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -114,14 +134,15 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateExpanded : global ReadOnly = false, Description = @"The kind of workbook. Only valid value is shared.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind) })] + PossibleTypes = new [] { typeof(string) })] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"""shared""")] + Script = @"""shared""", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind Kind { get => _workbookUpdateParametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind)""); set => _workbookUpdateParametersBody.Kind = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("shared")] + public string Kind { get => _workbookUpdateParametersBody.Kind ?? null; set => _workbookUpdateParametersBody.Kind = value; } /// Backing field for property. private string _linkedSourceId; @@ -162,7 +183,7 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -228,7 +249,7 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateExpanded : global Description = @"A list of 0 or more tags that are associated with this workbook definition", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - public string[] SourceTag { get => _workbookUpdateParametersBody.PropertiesTag ?? null /* arrayOf */; set => _workbookUpdateParametersBody.PropertiesTag = value; } + public string[] SourceTag { get => _workbookUpdateParametersBody.PropertiesTag?.ToArray() ?? null /* fixedArrayOf */; set => _workbookUpdateParametersBody.PropertiesTag = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _subscriptionId; @@ -244,7 +265,8 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateExpanded : global [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [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; } @@ -257,44 +279,44 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateExpanded : global ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags Tag { get => _workbookUpdateParametersBody.Tag ?? null /* object */; set => _workbookUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags Tag { get => _workbookUpdateParametersBody.Tag ?? null /* object */; set => _workbookUpdateParametersBody.Tag = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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); + 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) @@ -317,6 +339,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -381,8 +408,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -438,7 +490,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -448,15 +500,19 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("Kind")) + { + Kind = (string)this.MyInvocation.BoundParameters["Kind"]; + } 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.WorkbooksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.WorkbooksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null,body=_workbookUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -476,7 +532,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzApplicationInsightsWorkbook_UpdateExpanded() { @@ -500,12 +556,12 @@ public UpdateAzApplicationInsightsWorkbook_UpdateExpanded() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -517,8 +573,26 @@ public UpdateAzApplicationInsightsWorkbook_UpdateExpanded() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -526,12 +600,12 @@ public UpdateAzApplicationInsightsWorkbook_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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -548,15 +622,15 @@ public UpdateAzApplicationInsightsWorkbook_UpdateExpanded() 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, ResourceGroupName=ResourceGroupName, Name=Name, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=_workbookUpdateParametersBody }) + 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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=_workbookUpdateParametersBody }) + 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 } }); @@ -566,12 +640,12 @@ public UpdateAzApplicationInsightsWorkbook_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -583,8 +657,26 @@ public UpdateAzApplicationInsightsWorkbook_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded.cs index 4487e99c5e6c..3ce6cf0ba154 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; using System; - /// Updates a workbook that has already been added. + /// update a workbook that has already been added. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWorkbook_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PropertiesTag"}, NewOutputProperties=new string[] {"PropertiesTag"}, ChangeDescription="The type of property 'PropertiesTag' of type 'Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"Updates a workbook that has already been added.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update a workbook that has already been added.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] public partial class UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,16 +37,31 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpand /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// The parameters that can be provided when updating workbook properties properties. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParameters _workbookUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.WorkbookUpdateParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParameters _workbookUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.WorkbookUpdateParameters(); /// 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; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// Workbook category, as defined by the user at creation time. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Workbook category, as defined by the user at creation time.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Body)] @@ -91,6 +108,9 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpand PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workbookUpdateParametersBody.DisplayName ?? null; set => _workbookUpdateParametersBody.DisplayName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -122,14 +142,15 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpand ReadOnly = false, Description = @"The kind of workbook. Only valid value is shared.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind) })] + PossibleTypes = new [] { typeof(string) })] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"""shared""")] + Script = @"""shared""", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotExport] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind))] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind Kind { get => _workbookUpdateParametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind)""); set => _workbookUpdateParametersBody.Kind = value; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("shared")] + public string Kind { get => _workbookUpdateParametersBody.Kind ?? null; set => _workbookUpdateParametersBody.Kind = value; } /// Backing field for property. private string _linkedSourceId; @@ -156,7 +177,7 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpand /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.HttpPipeline Pipeline { get; set; } + public 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")] @@ -208,7 +229,7 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpand Description = @"A list of 0 or more tags that are associated with this workbook definition", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - public string[] SourceTag { get => _workbookUpdateParametersBody.PropertiesTag ?? null /* arrayOf */; set => _workbookUpdateParametersBody.PropertiesTag = value; } + public string[] SourceTag { get => _workbookUpdateParametersBody.PropertiesTag?.ToArray() ?? null /* fixedArrayOf */; set => _workbookUpdateParametersBody.PropertiesTag = (value != null ? new System.Collections.Generic.List(value) : null); } /// Resource tags. [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -219,44 +240,44 @@ public partial class UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpand ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags Tag { get => _workbookUpdateParametersBody.Tag ?? null /* object */; set => _workbookUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags Tag { get => _workbookUpdateParametersBody.Tag ?? null /* object */; set => _workbookUpdateParametersBody.Tag = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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); + 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) @@ -279,6 +300,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -343,8 +369,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.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 ); + 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 ; @@ -400,7 +451,7 @@ protected override void ProcessRecord() 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); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -410,12 +461,16 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("Kind")) + { + Kind = (string)this.MyInvocation.BoundParameters["Kind"]; + } 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.WorkbooksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.WorkbooksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } else { @@ -432,13 +487,13 @@ protected override void ProcessRecord() { 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.WorkbooksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.WorkbooksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _workbookUpdateParametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeUpdate); } 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 { LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null,body=_workbookUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -458,7 +513,8 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet + /// class. /// public UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded() { @@ -482,12 +538,12 @@ public UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -499,8 +555,26 @@ public UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -508,12 +582,12 @@ public UpdateAzApplicationInsightsWorkbook_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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -530,15 +604,15 @@ public UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded() 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 { LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=_workbookUpdateParametersBody }) + 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 { LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, body=_workbookUpdateParametersBody }) + 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 } }); @@ -548,12 +622,12 @@ public UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -565,8 +639,26 @@ public UpdateAzApplicationInsightsWorkbook_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaJsonFilePath.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..fb1e72135ffe --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaJsonFilePath.cs @@ -0,0 +1,591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update a workbook that has already been added. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWorkbook_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update a workbook that has already been added.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsWorkbook_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// Backing field for property. + private string _linkedSourceId; + + /// Azure Resource Id that will fetch all linked workbooks. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure Resource Id that will fetch all linked workbooks.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Id that will fetch all linked workbooks.", + SerializedName = @"sourceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] + public string LinkedSourceId { get => this._linkedSourceId; set => this._linkedSourceId = 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 resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [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. + /// + public 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", + SetCondition = @"")] + [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; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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 'WorkbooksUpdate' 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, this.ExtensibleParameters); + 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.WorkbooksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _jsonString, onOk, onCreated, 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) + { + 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(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsWorkbook_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaJsonString.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaJsonString.cs new file mode 100644 index 000000000000..7acf75bb3a3d --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/cmdlets/UpdateAzApplicationInsightsWorkbook_UpdateViaJsonString.cs @@ -0,0 +1,589 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets; + using System; + + /// update a workbook that has already been added. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzApplicationInsightsWorkbook_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Description(@"update a workbook that has already been added.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}", ApiVersion = "2022-04-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.NotSuggestDefaultParameterSet] + public partial class UpdateAzApplicationInsightsWorkbook_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// Backing field for property. + private string _linkedSourceId; + + /// Azure Resource Id that will fetch all linked workbooks. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure Resource Id that will fetch all linked workbooks.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure Resource Id that will fetch all linked workbooks.", + SerializedName = @"sourceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ParameterCategory.Query)] + public string LinkedSourceId { get => this._linkedSourceId; set => this._linkedSourceId = 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 resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [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. + /// + public 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", + SetCondition = @"")] + [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; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.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 'WorkbooksUpdate' 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, this.ExtensibleParameters); + 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.WorkbooksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null, _jsonString, onOk, onCreated, 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,ResourceGroupName=ResourceGroupName,Name=Name,LinkedSourceId=this.InvocationInformation.BoundParameters.ContainsKey("LinkedSourceId") ? LinkedSourceId : null}) + { + 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(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzApplicationInsightsWorkbook_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError + /// 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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbook + /// 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.IWorkbook + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..657441deac6e --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights +{ + using System; + using System.Collections.Generic; + using System.Text; + + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] + public class ExternalDocsAttribute : Attribute + { + + public string Description { get; } + + public string Url { get; } + + public ExternalDocsAttribute(string url) + { + Url = url; + } + + public ExternalDocsAttribute(string url, string description) + { + Url = url; + Description = description; + } + } +} diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..ae4fae6c6d69 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 674976e66aad..6aaae80c5eea 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -20,11 +20,13 @@ public class ExportFormatPs1xml : PSCmdlet public string FilePath { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @"Id,Type"; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index f11dcd2bbb9a..c0d981cc3a17 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -24,7 +24,7 @@ public class ExportModelSurface : PSCmdlet public bool UseExpandedFormat { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index bdb9ce14a09c..303ef2c324b6 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -70,9 +70,8 @@ protected override void ProcessRecord() var variantGroups = profileGroups.SelectMany(pg => pg.Variants .GroupBy(v => new { v.CmdletName, v.IsInternal }) .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), - Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) .ToArray(); - var license = new StringBuilder(); license.Append(@" # ---------------------------------------------------------------------------------- @@ -114,6 +113,7 @@ protected override void ProcessRecord() sb.Append("param("); sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) { var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 5db37f0fd6a3..f5188cf9cc02 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() } else { - var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList(); sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); } @@ -148,8 +148,10 @@ protected override void ProcessRecord() } else { - var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); - sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); + if (!String.IsNullOrEmpty(aliasesList)) { + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } } // CmdletsToExport diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index ea35027f8c99..9bbcfaba6722 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index be1f083bd03f..6144c6433df4 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -94,7 +94,7 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index 1b2368e73313..f3034f258ffc 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -36,14 +36,23 @@ internal class PsHelpInfo public object Role { get; } public string NonTerminatingErrors { get; } + public static string CapitalizeFirstLetter(string text) + { + if (string.IsNullOrEmpty(text)) + return text; + + return char.ToUpper(text[0]) + text.Substring(1); + } + public PsHelpInfo(PSObject helpObject = null) { helpObject = helpObject ?? new PSObject(); CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); ModuleName = helpObject.GetProperty("ModuleName"); - Synopsis = helpObject.GetProperty("Synopsis"); + Synopsis = CapitalizeFirstLetter(helpObject.GetProperty("Synopsis")); Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + Description = CapitalizeFirstLetter(Description); AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); Category = helpObject.GetProperty("Category"); HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 746334b8f34f..7b2e6b067dae 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -31,7 +31,7 @@ internal class MarkdownHelpInfo public string[] Inputs { get; } public string[] Outputs { get; } public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } - public string[] RelatedLinks { get; } + public MarkdownRelatedLinkInfo[] RelatedLinks { get; } public bool SupportsShouldProcess { get; } public bool SupportsPaging { get; } @@ -67,7 +67,11 @@ public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; OnlineVersion = commentInfo.OnlineVersion; - RelatedLinks = commentInfo.RelatedLinks; + + var relatedLinkLists = new List(); + relatedLinkLists.AddRange(commentInfo.RelatedLinks?.Select(link => new MarkdownRelatedLinkInfo(link))); + relatedLinkLists.AddRange(variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Distinct()?.Select(link => new MarkdownRelatedLinkInfo(link.Url, link.Description))); + RelatedLinks = relatedLinkLists?.ToArray(); SupportsShouldProcess = variantGroup.SupportsShouldProcess; SupportsPaging = variantGroup.SupportsPaging; @@ -218,14 +222,45 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param } } + internal class MarkdownRelatedLinkInfo + { + public string Url { get; } + public string Description { get; } + + public MarkdownRelatedLinkInfo(string url) + { + Url = url; + } + + public MarkdownRelatedLinkInfo(string url, string description) + { + Url = url; + Description = description; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(Description)) + { + return Url; + } + else + { + return $@"[{Description}]({Url})"; + + } + + } + } + internal static class MarkdownTypesExtensions { 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 }}", $@"{{{{ 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 }}"), + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 66c2bcb82c5b..6d25cf05d486 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 75d31e786773..7e3274f3a141 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -374,6 +392,7 @@ public CommentInfo(VariantGroup variantGroup) var helpInfo = variantGroup.HelpInfo; Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() ?? helpInfo.Description.EmptyIfNull(); + Description = PsHelpInfo.CapitalizeFirstLetter(Description); // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; Synopsis = synopsis.NullIfEmpty() ?? Description; @@ -391,6 +410,9 @@ public CommentInfo(VariantGroup variantGroup) 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(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +442,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +465,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +513,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +542,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 4763e83fa1a0..7d30095c4527 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -22,6 +22,11 @@ public class DoNotExportAttribute : Attribute { } + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class ModelCmdletAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Class)] public class InternalExportAttribute : Attribute { @@ -55,6 +60,11 @@ public class HttpPathAttribute : Attribute public string ApiVersion { get; set; } } + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -109,6 +119,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 3f98fc3ede8c..6388642fe81b 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerSh { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 28d12acc35eb..f12c9778bb5d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -67,7 +67,7 @@ public static IEnumerable GetScriptHelpInfo(params string[] modulePath public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) { - var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" )); return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) @@ -88,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Context.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..c1a6242d682b --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Context.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParameters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.ApplicationInsightsManagementClient Client { get; } + } +} diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Events.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Events.cs index e6fda7f6fc99..61fa7fd3b845 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Events.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Events.cs @@ -22,6 +22,6 @@ public static partial class Events public const string FollowingNextLink = nameof(FollowingNextLink); public const string DelayBeforePolling = nameof(DelayBeforePolling); public const string Polling = nameof(Polling); - + public const string Progress = nameof(Progress); } -} \ No newline at end of file +} diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/ISendAsync.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/ISendAsync.cs index ebce77a46934..a0854d820058 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/InfoAttribute.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/InfoAttribute.cs index c99f5743f201..5ce4ddd5baa7 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/InfoAttribute.cs @@ -11,6 +11,9 @@ public class InfoAttribute : Attribute { public bool Required { get; set; } = false; public bool ReadOnly { get; set; } = false; + public bool Read { get; set; } = true; + public bool Create { get; set; } = true; + public bool Update { get; set; } = true; public Type[] PossibleTypes { get; set; } = new Type[0]; public string Description { get; set; } = ""; public string SerializedName { get; set; } = ""; @@ -30,5 +33,6 @@ public class DefaultInfoAttribute : Attribute public string Script { get; set; } = ""; public string Name { get; set; } = ""; public string Description { get; set; } = ""; + public string SetCondition { get; set; } = ""; } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/InputHandler.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..1247078e61f4 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/InputHandler.cs @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Cmdlets +{ + public abstract class InputHandler + { + protected InputHandler NextHandler = null; + + public void SetNextHandler(InputHandler nextHandler) + { + this.NextHandler = nextHandler; + } + + public abstract void Process(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/MessageAttribute.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/MessageAttribute.cs index 8eb38e0eef6d..ce3cf52ecdfc 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime public class GenericBreakingChangeAttribute : Attribute { private string _message; - //A dexcription of what the change is about, non mandatory + //A description of what the change is about, non mandatory public string ChangeDescription { get; set; } = null; + //Name of the module that is being deprecated + public string moduleName { get; set; } = String.IsNullOrEmpty(@"") ? @"Az.ApplicationInsights" : @""; + //The version the change is effective from, non mandatory public string DeprecateByVersion { get; } public string DeprecateByAzVersion { get; } @@ -82,7 +85,7 @@ public void PrintCustomAttributeInfo(Action writeOutput) } writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); - writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.moduleName, this.DeprecateByVersion)); if (OldWay != null && NewWay != null) { @@ -191,11 +194,11 @@ public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this( this.IsEstimatedGaDateSet = true; } } - + public void PrintCustomAttributeInfo(Action writeOutput) { writeOutput(this._message); - + if (IsEstimatedGaDateSet) { writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 58f7c3a729d6..3b6b6abdbbff 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Properties/Resources.resx b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/Properties/Resources.resx @@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can -- The change is expected to take effect from version : '{0}' +- The change is expected to take effect in '{0}' from version : '{1}' ```powershell diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/SerializationMode.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/SerializationMode.cs index 9f43dbc72dd6..2d8bc7efaf50 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/SerializationMode.cs @@ -9,8 +9,10 @@ public enum SerializationMode { None = 0, IncludeHeaders = 1 << 0, - IncludeReadOnly = 1 << 1, - - IncludeAll = IncludeHeaders | IncludeReadOnly + IncludeRead = 1 << 1, + IncludeCreate = 1 << 2, + IncludeUpdate = 1 << 3, + IncludeAll = IncludeHeaders | IncludeRead | IncludeCreate | IncludeUpdate, + IncludeCreateOrUpdate = IncludeCreate | IncludeUpdate } } \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/TypeConverterExtensions.cs index 6f84d529aa46..9a1c9489304d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Clear-AzApplicationInsights.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Clear-AzApplicationInsights.ps1 index 26a924b9f095..77934336e93c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Clear-AzApplicationInsights.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Clear-AzApplicationInsights.ps1 @@ -30,19 +30,19 @@ You should run the query prior to using for a purge request to verify that the r .Example {{ Add code here }} -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody .Outputs -System.String +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse .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. + 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. @@ -65,18 +65,20 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/clear-azapplicationinsights #> function Clear-AzApplicationInsights { -[OutputType([System.String])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse])] [CmdletBinding(DefaultParameterSetName='PurgeViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Purge', Mandatory)] [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Parameter(ParameterSetName='PurgeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PurgeViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -85,6 +87,8 @@ param( [Parameter(ParameterSetName='Purge', Mandatory)] [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Parameter(ParameterSetName='PurgeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PurgeViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -93,6 +97,8 @@ param( [Parameter(ParameterSetName='Purge')] [Parameter(ParameterSetName='PurgeExpanded')] + [Parameter(ParameterSetName='PurgeViaJsonFilePath')] + [Parameter(ParameterSetName='PurgeViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -104,24 +110,21 @@ param( [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] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)] @@ -131,6 +134,18 @@ param( # Table from which to purge data. ${Table}, + [Parameter(ParameterSetName='PurgeViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Purge operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PurgeViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Purge operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -187,16 +202,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $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'; + PurgeViaJsonFilePath = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeViaJsonFilePath'; + PurgeViaJsonString = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeViaJsonString'; } - if (('Purge', 'PurgeExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Purge', 'PurgeExpanded', 'PurgeViaJsonFilePath', 'PurgeViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -205,6 +223,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsights.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsights.ps1 index 7d46257c0373..06983cd9e318 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsights.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsights.ps1 @@ -27,7 +27,7 @@ Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePr .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Notes COMPLEX PARAMETER PROPERTIES @@ -43,14 +43,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsights #> function Get-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -81,7 +81,6 @@ param( [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()] @@ -140,6 +139,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_Get'; @@ -147,9 +149,7 @@ begin { 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')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -158,6 +158,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsAnnotation.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsAnnotation.ps1 index 2a24aee1ec3c..6f7c48a7dda9 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsAnnotation.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsAnnotation.ps1 @@ -27,12 +27,26 @@ Get the annotation for given id. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -43,17 +57,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsannotation #> function Get-AzApplicationInsightsAnnotation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityComponent', Mandatory)] [Alias('AnnotationId')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -88,9 +103,14 @@ param( [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='GetViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] [System.String] @@ -159,15 +179,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_GetViaIdentity'; + GetViaIdentityComponent = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_GetViaIdentityComponent'; List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -176,6 +198,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentAvailableFeature.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentAvailableFeature.ps1 index 25ee86ac6361..f8e512199e10 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentAvailableFeature.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentAvailableFeature.ps1 @@ -27,7 +27,7 @@ Returns all available features of the application insights component. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures .Notes COMPLEX PARAMETER PROPERTIES @@ -43,14 +43,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentavailablefeature #> function Get-AzApplicationInsightsComponentAvailableFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [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()] @@ -137,14 +136,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentAvailableFeature_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentAvailableFeature_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -153,6 +153,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentCurrentBillingFeature.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentCurrentBillingFeature.ps1 index 3b5e0c76ac7f..7ca566490819 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentCurrentBillingFeature.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentCurrentBillingFeature.ps1 @@ -27,7 +27,7 @@ Returns current billing features for an Application Insights component. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures .Notes COMPLEX PARAMETER PROPERTIES @@ -43,14 +43,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentcurrentbillingfeature #> function Get-AzApplicationInsightsComponentCurrentBillingFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [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()] @@ -137,14 +136,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentCurrentBillingFeature_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -153,6 +153,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentFeatureCapability.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentFeatureCapability.ps1 index a2307c341c06..25793844e99f 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentFeatureCapability.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentFeatureCapability.ps1 @@ -27,7 +27,7 @@ Returns feature capabilities of the application insights component. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities .Notes COMPLEX PARAMETER PROPERTIES @@ -43,14 +43,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentfeaturecapability #> function Get-AzApplicationInsightsComponentFeatureCapability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [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()] @@ -137,14 +136,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentFeatureCapability_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentFeatureCapability_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -153,6 +153,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentPurgeStatus.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentPurgeStatus.ps1 index 0fb447684fb0..a016dd7aae26 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentPurgeStatus.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentPurgeStatus.ps1 @@ -27,12 +27,26 @@ Get status for an ongoing purge operation. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse .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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -43,14 +57,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentpurgestatus #> function Get-AzApplicationInsightsComponentPurgeStatus { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -61,6 +75,7 @@ param( ${Name}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityComponent', 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. @@ -84,9 +99,14 @@ param( [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='GetViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -143,14 +163,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_GetViaIdentity'; + GetViaIdentityComponent = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_GetViaIdentityComponent'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -159,6 +181,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentQuotaStatus.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentQuotaStatus.ps1 index fb7f5e665959..58b070d20e13 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentQuotaStatus.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsComponentQuotaStatus.ps1 @@ -27,7 +27,7 @@ Returns daily data volume cap (quota) status for an Application Insights compone .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus .Notes COMPLEX PARAMETER PROPERTIES @@ -43,14 +43,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentquotastatus #> function Get-AzApplicationInsightsComponentQuotaStatus { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [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()] @@ -137,14 +136,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentQuotaStatus_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentQuotaStatus_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -153,6 +153,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsOperation.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsOperation.ps1 index 1efaf46ec141..7eb58566794a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsOperation.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Get-AzApplicationInsightsOperation.ps1 @@ -25,12 +25,12 @@ Lists all of the available insights REST API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsoperation #> function Get-AzApplicationInsightsOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsights.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsights.ps1 index 78131d9ef912..3a53c89af2be 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsights.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsights.ps1 @@ -16,20 +16,20 @@ <# .Synopsis -Creates (or updates) an Application Insights component. +Create (or create 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. +Create (or create an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Example New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Notes COMPLEX PARAMETER PROPERTIES @@ -45,39 +45,41 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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. INSIGHTPROPERTY : An Application Insights component definition. - Location : Resource location 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. + [Location ]: Resource location [Tag ]: Resource tags [(Any) ]: This indicates any property can be added to this object. - [ApplicationType ]: Type of application being monitored. + [ApplicationType ]: Type of application being monitored. [DisableIPMasking ]: Disable IP masking. [DisableLocalAuth ]: Disable Non-AAD based Auth. [Etag ]: Resource etag - [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 ]: 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. [ForceCustomerStorageForProfiler ]: Force users to create their own storage account for profiler and debugger. - [HockeyAppId ]: The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + [HockeyAppId ]: The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. Please visit external url https://aka.ms/ewjuel to get more information. [ImmediatePurgeDataOn30Day ]: Purge data immediately after 30 days. - [IngestionMode ]: Indicates the flow of the ingestion. - [PublicNetworkAccessForIngestion ]: The network access type for accessing Application Insights ingestion. - [PublicNetworkAccessForQuery ]: The network access type for accessing Application Insights query. - [RequestSource ]: Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. + [IngestionMode ]: Indicates the flow of the ingestion. + [PublicNetworkAccessForIngestion ]: The network access type for accessing Application Insights ingestion. + [PublicNetworkAccessForQuery ]: The network access type for accessing Application Insights query. + [RequestSource ]: Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. [RetentionInDay ]: Retention period in days. - [SamplingPercentage ]: Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + [SamplingPercentage ]: Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. Please visit external url https://aka.ms/sl0yqd to get more information. [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. .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights #> function New-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -86,6 +88,8 @@ param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -94,6 +98,8 @@ param( [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -105,15 +111,13 @@ param( [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='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent] # An Application Insights component definition. - # To construct, see NOTES section for INSIGHTPROPERTY properties and create a hash table. ${InsightProperty}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] @@ -133,9 +137,9 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + [System.String] # Type of application being monitored. ${ApplicationType}, @@ -162,9 +166,9 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + [System.String] # 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}, @@ -181,6 +185,7 @@ param( [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. + # Please visit external url https://aka.ms/ewjuel to get more information. ${HockeyAppId}, [Parameter(ParameterSetName='CreateExpanded')] @@ -192,33 +197,33 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + [System.String] # Indicates the flow of the ingestion. ${IngestionMode}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights ingestion. ${PublicNetworkAccessForIngestion}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights query. ${PublicNetworkAccessForQuery}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + [System.String] # Describes what tool created this Application Insights component. # Customers using this API should set this to the default 'rest'. ${RequestSource}, @@ -235,12 +240,13 @@ param( [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. + # Please visit external url https://aka.ms/sl0yqd to get more information. ${SamplingPercentage}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -254,6 +260,18 @@ param( # Applications from older versions will not have this property. ${WorkspaceResourceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -310,16 +328,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Create = 'Az.ApplicationInsights.private\New-AzApplicationInsights_Create'; CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateExpanded'; CreateViaIdentity = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateViaJsonString'; } - if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -328,6 +349,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsAnnotation.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsAnnotation.ps1 index 595ce7918b69..ef5b029f9df0 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsAnnotation.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsAnnotation.ps1 @@ -25,11 +25,11 @@ Create an Annotation of an Application Insights component. {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation .Notes COMPLEX PARAMETER PROPERTIES @@ -53,18 +53,20 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsannotation #> function New-AzApplicationInsightsAnnotation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -73,6 +75,8 @@ param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the Application Insights component resource. @@ -80,6 +84,8 @@ param( [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -91,15 +97,13 @@ param( [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='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation] # Annotation associated with an application insights resource. - # To construct, see NOTES section for ANNOTATIONPROPERTY properties and create a hash table. ${AnnotationProperty}, [Parameter(ParameterSetName='CreateExpanded')] @@ -144,6 +148,18 @@ param( # Related parent annotation if any ${RelatedAnnotation}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -200,16 +216,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Create = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_Create'; CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateExpanded'; CreateViaIdentity = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateViaJsonString'; } - if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -218,6 +237,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsApiKey.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsApiKey.ps1 index 312837997f2e..49e295c52e4a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsApiKey.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsApiKey.ps1 @@ -26,12 +26,12 @@ New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Des .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey #> function New-AzApplicationInsightsApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -55,26 +55,38 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The name of the API Key. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # The read access rights of this API Key. ${LinkedReadProperty}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # The write access rights of this API Key. ${LinkedWriteProperty}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -131,13 +143,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsApiKey_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsApiKey_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsApiKey_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -146,6 +161,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsContinuousExport.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsContinuousExport.ps1 index 129ae1b35963..2657ae517cd8 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsContinuousExport.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsContinuousExport.ps1 @@ -20,6 +20,7 @@ Create a Continuous Export configuration of an Application Insights component. .Description Create a Continuous Export configuration of an Application Insights component. .Example +$context = "*****" $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" ` @@ -27,11 +28,11 @@ New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " -StorageSASUri $sasuri -DestinationType Blob .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration .Notes COMPLEX PARAMETER PROPERTIES @@ -58,18 +59,20 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport #> function New-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -78,6 +81,8 @@ param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -86,6 +91,8 @@ param( [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -97,15 +104,13 @@ param( [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='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest] # An Application Insights component Continuous Export configuration request definition. - # To construct, see NOTES section for EXPORTPROPERTY properties and create a hash table. ${ExportProperty}, [Parameter(ParameterSetName='CreateExpanded')] @@ -174,6 +179,18 @@ param( # It must grant write permission. ${StorageSASUri}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -230,16 +247,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Create = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_Create'; CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateExpanded'; CreateViaIdentity = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateViaJsonString'; } - if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -248,6 +268,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsWebTest.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsWebTest.ps1 index 8f3bd95b811b..6a62881aba4a 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsWebTest.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/New-AzApplicationInsightsWebTest.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Creates or updates an Application Insights web test definition. +Create an Application Insights web test definition. .Description -Creates or updates an Application Insights web test definition. +Create an Application Insights web test definition. .Example $geoLocation = @() $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" @@ -72,7 +72,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwe " .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest .Notes COMPLEX PARAMETER PROPERTIES @@ -88,7 +88,7 @@ REQUESTHEADER : List of headers and their values to add to the W https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest #> function New-AzApplicationInsightsWebTest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -112,161 +112,171 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Resource location ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The XML specification of a WebTest to run against an application. ${Configuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # When set, this value makes the ContentMatch validation case insensitive. ${ContentIgnoreCase}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [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()] + [Parameter(ParameterSetName='CreateExpanded')] [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()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # User defined description for this WebTest. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Is the test actively being monitored. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Interval in seconds between test runs for this WebTest. # Default value is 300. ${Frequency}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] + [System.String] # The kind of web test this is, valid choices are ping, multistep, and standard. ${Kind}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Base64 encoded string body to send with this web test. ${RequestBody}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Follow redirects for this web test. ${RequestFollowRedirect}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Http verb to use for this web test. ${RequestHttpVerb}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Parse Dependent request for this WebTest. ${RequestParseDependent}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Url location to test. ${RequestUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Allow for retries should this WebTest fail. ${RetryEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Validate that the WebTest returns the http status code provided. ${RuleExpectedHttpStatusCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # When set, validation will ignore the status code. ${RuleIgnoreHttpsStatusCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [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()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Checks to see if the SSL cert is still valid. ${RuleSslCheck}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # User defined name if this WebTest. ${TestName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Seconds until this WebTest will timeout and fail. # Default value is 30. ${Timeout}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -323,13 +333,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWebTest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWebTest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWebTest_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -338,6 +351,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/ProxyCmdletDefinitions.ps1 index 02cfd075a000..4c776fe4a29e 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -30,19 +30,19 @@ You should run the query prior to using for a purge request to verify that the r .Example {{ Add code here }} -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBody .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBody .Outputs -System.String +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse .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. + 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. @@ -65,18 +65,20 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/clear-azapplicationinsights #> function Clear-AzApplicationInsights { -[OutputType([System.String])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeResponse])] [CmdletBinding(DefaultParameterSetName='PurgeViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Purge', Mandatory)] [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Parameter(ParameterSetName='PurgeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PurgeViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -85,6 +87,8 @@ param( [Parameter(ParameterSetName='Purge', Mandatory)] [Parameter(ParameterSetName='PurgeExpanded', Mandatory)] + [Parameter(ParameterSetName='PurgeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PurgeViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -93,6 +97,8 @@ param( [Parameter(ParameterSetName='Purge')] [Parameter(ParameterSetName='PurgeExpanded')] + [Parameter(ParameterSetName='PurgeViaJsonFilePath')] + [Parameter(ParameterSetName='PurgeViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -104,24 +110,21 @@ param( [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] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)] @@ -131,6 +134,18 @@ param( # Table from which to purge data. ${Table}, + [Parameter(ParameterSetName='PurgeViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Purge operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PurgeViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Purge operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -187,16 +202,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $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'; + PurgeViaJsonFilePath = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeViaJsonFilePath'; + PurgeViaJsonString = 'Az.ApplicationInsights.private\Clear-AzApplicationInsights_PurgeViaJsonString'; } - if (('Purge', 'PurgeExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Purge', 'PurgeExpanded', 'PurgeViaJsonFilePath', 'PurgeViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -205,6 +223,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -247,12 +268,26 @@ Get the annotation for given id. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -263,17 +298,18 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsannotation #> function Get-AzApplicationInsightsAnnotation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityComponent', Mandatory)] [Alias('AnnotationId')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -308,9 +344,14 @@ param( [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='GetViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Query')] [System.String] @@ -379,15 +420,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_GetViaIdentity'; + GetViaIdentityComponent = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_GetViaIdentityComponent'; List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsAnnotation_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -396,6 +439,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -438,7 +484,7 @@ Returns all available features of the application insights component. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures .Notes COMPLEX PARAMETER PROPERTIES @@ -454,14 +500,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentavailablefeature #> function Get-AzApplicationInsightsComponentAvailableFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeatures])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -489,7 +535,6 @@ param( [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()] @@ -548,14 +593,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentAvailableFeature_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentAvailableFeature_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -564,6 +610,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -606,7 +655,7 @@ Returns current billing features for an Application Insights component. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures .Notes COMPLEX PARAMETER PROPERTIES @@ -622,14 +671,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentcurrentbillingfeature #> function Get-AzApplicationInsightsComponentCurrentBillingFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -657,7 +706,6 @@ param( [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()] @@ -716,14 +764,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentCurrentBillingFeature_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentCurrentBillingFeature_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -732,6 +781,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -774,7 +826,7 @@ Returns feature capabilities of the application insights component. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities .Notes COMPLEX PARAMETER PROPERTIES @@ -790,14 +842,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentfeaturecapability #> function Get-AzApplicationInsightsComponentFeatureCapability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilities])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapabilities])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -825,7 +877,6 @@ param( [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()] @@ -884,14 +935,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentFeatureCapability_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentFeatureCapability_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -900,6 +952,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -942,12 +997,26 @@ Get status for an ongoing purge operation. .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse .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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -958,14 +1027,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentpurgestatus #> function Get-AzApplicationInsightsComponentPurgeStatus { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponse])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -976,6 +1045,7 @@ param( ${Name}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityComponent', 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. @@ -999,9 +1069,14 @@ param( [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='GetViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1058,14 +1133,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_GetViaIdentity'; + GetViaIdentityComponent = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentPurgeStatus_GetViaIdentityComponent'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1074,6 +1151,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1116,7 +1196,7 @@ Returns daily data volume cap (quota) status for an Application Insights compone .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus .Notes COMPLEX PARAMETER PROPERTIES @@ -1132,14 +1212,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightscomponentquotastatus #> function Get-AzApplicationInsightsComponentQuotaStatus { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1167,7 +1247,6 @@ param( [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()] @@ -1226,14 +1305,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentQuotaStatus_Get'; GetViaIdentity = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsComponentQuotaStatus_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1242,6 +1322,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1282,12 +1365,12 @@ Lists all of the available insights REST API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsightsoperation #> function Get-AzApplicationInsightsOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -1346,12 +1429,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ApplicationInsights.private\Get-AzApplicationInsightsOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1394,7 +1483,7 @@ Get-AzApplicationInsights -ResourceGroupName "testgroup" -Name "test" -IncludePr .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Notes COMPLEX PARAMETER PROPERTIES @@ -1410,14 +1499,14 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/get-azapplicationinsights #> function Get-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1448,7 +1537,6 @@ param( [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()] @@ -1507,6 +1595,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.ApplicationInsights.private\Get-AzApplicationInsights_Get'; @@ -1514,9 +1605,7 @@ begin { 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')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1525,6 +1614,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1565,11 +1657,11 @@ Create an Annotation of an Application Insights component. {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation .Notes COMPLEX PARAMETER PROPERTIES @@ -1593,18 +1685,20 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsannotation #> function New-AzApplicationInsightsAnnotation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -1613,6 +1707,8 @@ param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the Application Insights component resource. @@ -1620,6 +1716,8 @@ param( [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -1631,15 +1729,13 @@ param( [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='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation] # Annotation associated with an application insights resource. - # To construct, see NOTES section for ANNOTATIONPROPERTY properties and create a hash table. ${AnnotationProperty}, [Parameter(ParameterSetName='CreateExpanded')] @@ -1684,6 +1780,18 @@ param( # Related parent annotation if any ${RelatedAnnotation}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1740,16 +1848,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Create = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_Create'; CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateExpanded'; CreateViaIdentity = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsAnnotation_CreateViaJsonString'; } - if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1758,6 +1869,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1799,12 +1913,12 @@ New-AzApplicationInsightsApiKey -ResourceGroupName "testGroup" -Name "test" -Des .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightsapikey #> function New-AzApplicationInsightsApiKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -1828,26 +1942,38 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The name of the API Key. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # The read access rights of this API Key. ${LinkedReadProperty}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String[]] # The write access rights of this API Key. ${LinkedWriteProperty}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1904,13 +2030,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsApiKey_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsApiKey_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsApiKey_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1919,6 +2048,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1954,6 +2086,7 @@ Create a Continuous Export configuration of an Application Insights component. .Description Create a Continuous Export configuration of an Application Insights component. .Example +$context = "*****" $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" ` @@ -1961,11 +2094,11 @@ New-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " -StorageSASUri $sasuri -DestinationType Blob .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration .Notes COMPLEX PARAMETER PROPERTIES @@ -1992,18 +2125,20 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightscontinuousexport #> function New-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -2012,6 +2147,8 @@ param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -2020,6 +2157,8 @@ param( [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -2031,15 +2170,13 @@ param( [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='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest] # An Application Insights component Continuous Export configuration request definition. - # To construct, see NOTES section for EXPORTPROPERTY properties and create a hash table. ${ExportProperty}, [Parameter(ParameterSetName='CreateExpanded')] @@ -2108,6 +2245,18 @@ param( # It must grant write permission. ${StorageSASUri}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2164,16 +2313,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Create = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_Create'; CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateExpanded'; CreateViaIdentity = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsContinuousExport_CreateViaJsonString'; } - if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2182,6 +2334,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2213,9 +2368,9 @@ end { <# .Synopsis -Creates or updates an Application Insights web test definition. +Create an Application Insights web test definition. .Description -Creates or updates an Application Insights web test definition. +Create an Application Insights web test definition. .Example $geoLocation = @() $geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr" @@ -2269,7 +2424,7 @@ New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwe " .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest .Notes COMPLEX PARAMETER PROPERTIES @@ -2285,7 +2440,7 @@ REQUESTHEADER : List of headers and their values to add to the W https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsightswebtest #> function New-AzApplicationInsightsWebTest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -2309,161 +2464,171 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Resource location ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # The XML specification of a WebTest to run against an application. ${Configuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # When set, this value makes the ContentMatch validation case insensitive. ${ContentIgnoreCase}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [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()] + [Parameter(ParameterSetName='CreateExpanded')] [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()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # User defined description for this WebTest. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Is the test actively being monitored. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Interval in seconds between test runs for this WebTest. # Default value is 300. ${Frequency}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum] + [System.String] # The kind of web test this is, valid choices are ping, multistep, and standard. ${Kind}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Base64 encoded string body to send with this web test. ${RequestBody}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Follow redirects for this web test. ${RequestFollowRedirect}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[]] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Http verb to use for this web test. ${RequestHttpVerb}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Parse Dependent request for this WebTest. ${RequestParseDependent}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # Url location to test. ${RequestUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Allow for retries should this WebTest fail. ${RetryEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Validate that the WebTest returns the http status code provided. ${RuleExpectedHttpStatusCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # When set, validation will ignore the status code. ${RuleIgnoreHttpsStatusCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [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()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Management.Automation.SwitchParameter] # Checks to see if the SSL cert is still valid. ${RuleSslCheck}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.String] # User defined name if this WebTest. ${TestName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] [System.Int32] # Seconds until this WebTest will timeout and fail. # Default value is 30. ${Timeout}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2520,13 +2685,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWebTest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWebTest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsightsWebTest_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2535,6 +2703,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2566,20 +2737,20 @@ end { <# .Synopsis -Creates (or updates) an Application Insights component. +Create (or create 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. +Create (or create an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Example New-AzApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Notes COMPLEX PARAMETER PROPERTIES @@ -2595,39 +2766,41 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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. INSIGHTPROPERTY : An Application Insights component definition. - Location : Resource location 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. + [Location ]: Resource location [Tag ]: Resource tags [(Any) ]: This indicates any property can be added to this object. - [ApplicationType ]: Type of application being monitored. + [ApplicationType ]: Type of application being monitored. [DisableIPMasking ]: Disable IP masking. [DisableLocalAuth ]: Disable Non-AAD based Auth. [Etag ]: Resource etag - [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 ]: 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. [ForceCustomerStorageForProfiler ]: Force users to create their own storage account for profiler and debugger. - [HockeyAppId ]: The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + [HockeyAppId ]: The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. Please visit external url https://aka.ms/ewjuel to get more information. [ImmediatePurgeDataOn30Day ]: Purge data immediately after 30 days. - [IngestionMode ]: Indicates the flow of the ingestion. - [PublicNetworkAccessForIngestion ]: The network access type for accessing Application Insights ingestion. - [PublicNetworkAccessForQuery ]: The network access type for accessing Application Insights query. - [RequestSource ]: Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. + [IngestionMode ]: Indicates the flow of the ingestion. + [PublicNetworkAccessForIngestion ]: The network access type for accessing Application Insights ingestion. + [PublicNetworkAccessForQuery ]: The network access type for accessing Application Insights query. + [RequestSource ]: Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. [RetentionInDay ]: Retention period in days. - [SamplingPercentage ]: Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + [SamplingPercentage ]: Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. Please visit external url https://aka.ms/sl0yqd to get more information. [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. .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/new-azapplicationinsights #> function New-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -2636,6 +2809,8 @@ param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -2644,6 +2819,8 @@ param( [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -2655,15 +2832,13 @@ param( [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='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent] # An Application Insights component definition. - # To construct, see NOTES section for INSIGHTPROPERTY properties and create a hash table. ${InsightProperty}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] @@ -2683,9 +2858,9 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + [System.String] # Type of application being monitored. ${ApplicationType}, @@ -2712,9 +2887,9 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + [System.String] # 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}, @@ -2731,6 +2906,7 @@ param( [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. + # Please visit external url https://aka.ms/ewjuel to get more information. ${HockeyAppId}, [Parameter(ParameterSetName='CreateExpanded')] @@ -2742,33 +2918,33 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + [System.String] # Indicates the flow of the ingestion. ${IngestionMode}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights ingestion. ${PublicNetworkAccessForIngestion}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights query. ${PublicNetworkAccessForQuery}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + [System.String] # Describes what tool created this Application Insights component. # Customers using this API should set this to the default 'rest'. ${RequestSource}, @@ -2785,12 +2961,13 @@ param( [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. + # Please visit external url https://aka.ms/sl0yqd to get more information. ${SamplingPercentage}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -2804,6 +2981,18 @@ param( # Applications from older versions will not have this property. ${WorkspaceResourceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2860,16 +3049,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Create = 'Az.ApplicationInsights.private\New-AzApplicationInsights_Create'; CreateExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateExpanded'; CreateViaIdentity = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ApplicationInsights.private\New-AzApplicationInsights_CreateViaJsonString'; } - if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2878,6 +3070,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2926,6 +3121,20 @@ 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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -2936,7 +3145,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -2947,6 +3156,7 @@ function Remove-AzApplicationInsightsAnnotation { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityComponent', Mandatory)] [Alias('AnnotationId')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -2978,9 +3188,14 @@ param( [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='DeleteViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3043,14 +3258,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_DeleteViaIdentity'; + DeleteViaIdentityComponent = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_DeleteViaIdentityComponent'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3059,6 +3276,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3099,16 +3319,16 @@ Update current billing features for an Application Insights component. {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. BILLINGFEATURESPROPERTY : An Application Insights component billing features - [CurrentBillingFeature ]: Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + [CurrentBillingFeature >]: Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. [DataVolumeCapCap ]: Daily data volume cap in GB. [DataVolumeCapStopSendNotificationWhenHitCap ]: Do not send a notification email when the daily data volume cap is met. [DataVolumeCapStopSendNotificationWhenHitThreshold ]: Reserved, not used for now. @@ -3117,7 +3337,7 @@ BILLINGFEATURESPROPERTY : An Appli https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscomponentcurrentbillingfeature #> function Set-AzApplicationInsightsComponentCurrentBillingFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -3143,9 +3363,8 @@ param( [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures] # An Application Insights component billing features - # To construct, see NOTES section for BILLINGFEATURESPROPERTY properties and create a hash table. ${BillingFeaturesProperty}, [Parameter(ParameterSetName='UpdateExpanded')] @@ -3180,6 +3399,18 @@ param( # Reserved, not used for now. ${DataVolumeCapWarningThreshold}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3236,14 +3467,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Update = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_Update'; UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonString'; } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3252,6 +3486,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3287,6 +3524,7 @@ Update the Continuous Export configuration for this export id. .Description Update the Continuous Export configuration for this export id. .Example +$context = "*****" $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" ` @@ -3294,9 +3532,9 @@ Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " -StorageSASUri $sasuri -DestinationType Blob .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration .Notes COMPLEX PARAMETER PROPERTIES @@ -3316,7 +3554,7 @@ EXPORTPROPERTY : An Application Insi https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscontinuousexport #> function Set-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -3349,9 +3587,8 @@ param( [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest] # An Application Insights component Continuous Export configuration request definition. - # To construct, see NOTES section for EXPORTPROPERTY properties and create a hash table. ${ExportProperty}, [Parameter(ParameterSetName='UpdateExpanded')] @@ -3411,6 +3648,18 @@ param( # It must grant write permission. ${StorageSASUri}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3467,14 +3716,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Update = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_Update'; UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_UpdateViaJsonString'; } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3483,6 +3735,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3514,10 +3769,10 @@ end { <# .Synopsis -Creates (or updates) an Application Insights component. +Update (or update 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. +Update (or update an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Example {{ Add code here }} @@ -3525,39 +3780,39 @@ Note: You cannot specify a different value for InstrumentationKey nor AppId in t {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. INSIGHTPROPERTY : An Application Insights component definition. - Location : Resource location 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. + [Location ]: Resource location [Tag ]: Resource tags [(Any) ]: This indicates any property can be added to this object. - [ApplicationType ]: Type of application being monitored. + [ApplicationType ]: Type of application being monitored. [DisableIPMasking ]: Disable IP masking. [DisableLocalAuth ]: Disable Non-AAD based Auth. [Etag ]: Resource etag - [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 ]: 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. [ForceCustomerStorageForProfiler ]: Force users to create their own storage account for profiler and debugger. - [HockeyAppId ]: The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + [HockeyAppId ]: The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. Please visit external url https://aka.ms/ewjuel to get more information. [ImmediatePurgeDataOn30Day ]: Purge data immediately after 30 days. - [IngestionMode ]: Indicates the flow of the ingestion. - [PublicNetworkAccessForIngestion ]: The network access type for accessing Application Insights ingestion. - [PublicNetworkAccessForQuery ]: The network access type for accessing Application Insights query. - [RequestSource ]: Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. + [IngestionMode ]: Indicates the flow of the ingestion. + [PublicNetworkAccessForIngestion ]: The network access type for accessing Application Insights ingestion. + [PublicNetworkAccessForQuery ]: The network access type for accessing Application Insights query. + [RequestSource ]: Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. [RetentionInDay ]: Retention period in days. - [SamplingPercentage ]: Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + [SamplingPercentage ]: Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. Please visit external url https://aka.ms/sl0yqd to get more information. [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. .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsights #> function Set-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -3583,9 +3838,8 @@ param( [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent] # An Application Insights component definition. - # To construct, see NOTES section for INSIGHTPROPERTY properties and create a hash table. ${InsightProperty}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -3602,9 +3856,9 @@ param( ${Location}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + [System.String] # Type of application being monitored. ${ApplicationType}, @@ -3627,9 +3881,9 @@ param( ${Etag}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + [System.String] # 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}, @@ -3644,6 +3898,7 @@ param( [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. + # Please visit external url https://aka.ms/ewjuel to get more information. ${HockeyAppId}, [Parameter(ParameterSetName='UpdateExpanded')] @@ -3653,30 +3908,30 @@ param( ${ImmediatePurgeDataOn30Day}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + [System.String] # Indicates the flow of the ingestion. ${IngestionMode}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights ingestion. ${PublicNetworkAccessForIngestion}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights query. ${PublicNetworkAccessForQuery}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + [System.String] # Describes what tool created this Application Insights component. # Customers using this API should set this to the default 'rest'. ${RequestSource}, @@ -3691,11 +3946,12 @@ param( [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. + # Please visit external url https://aka.ms/sl0yqd to get more information. ${SamplingPercentage}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -3708,6 +3964,18 @@ param( # Applications from older versions will not have this property. ${WorkspaceResourceId}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3764,14 +4032,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Update = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_Update'; UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_UpdateViaJsonString'; } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3780,6 +4051,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3811,22 +4085,252 @@ end { <# .Synopsis -Updates an existing component's tags. -To update other fields use the CreateOrUpdate method. +Update current billing features for an Application Insights component. .Description -Updates an existing component's tags. -To update other fields use the CreateOrUpdate method. +Update current billing features for an Application Insights component. .Example {{ Add code here }} .Example {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. + +BILLINGFEATURESPROPERTY : An Application Insights component billing features + [CurrentBillingFeature >]: Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + [DataVolumeCapCap ]: Daily data volume cap in GB. + [DataVolumeCapStopSendNotificationWhenHitCap ]: Do not send a notification email when the daily data volume cap is met. + [DataVolumeCapStopSendNotificationWhenHitThreshold ]: Reserved, not used for now. + [DataVolumeCapWarningThreshold ]: Reserved, not used for now. + +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. + [RevisionId ]: The id of the workbook's revision. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightscomponentcurrentbillingfeature +#> +function Update-AzApplicationInsightsComponentCurrentBillingFeature { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Update', Mandatory)] + [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='Update', 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(ParameterSetName='Update')] + [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='UpdateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures] + # An Application Insights component billing features + ${BillingFeaturesProperty}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [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(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Single] + # Daily data volume cap in GB. + ${DataVolumeCap}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [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(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Reserved, not used for now. + ${DataVolumeCapStopSendNotificationWhenHitThreshold}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $mapping = @{ + Update = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentCurrentBillingFeature_Update'; + UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded'; + UpdateViaIdentity = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentity'; + UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentityExpanded'; + } + if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $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 an existing component's tags. +To update other fields use the CreateOrupdate method. +.Description +Update 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 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Notes COMPLEX PARAMETER PROPERTIES @@ -3846,18 +4350,20 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightscomponenttag #> function Update-AzApplicationInsightsComponentTag { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -3866,6 +4372,8 @@ param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -3874,6 +4382,8 @@ param( [Parameter(ParameterSetName='Update')] [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -3885,25 +4395,35 @@ param( [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='Update', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource] # A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - # To construct, see NOTES section for COMPONENTTAG properties and create a hash table. ${ComponentTag}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3960,16 +4480,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Update = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_Update'; UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateExpanded'; UpdateViaIdentity = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaJsonString'; } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -3978,6 +4501,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Remove-AzApplicationInsightsAnnotation.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Remove-AzApplicationInsightsAnnotation.ps1 index 5a1a40dee9f3..de8ca74f024c 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Remove-AzApplicationInsightsAnnotation.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Remove-AzApplicationInsightsAnnotation.ps1 @@ -33,6 +33,20 @@ 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. +COMPONENTINPUTOBJECT : 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. + [RevisionId ]: The id of the workbook's revision. + [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. + 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. @@ -43,7 +57,7 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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 @@ -54,6 +68,7 @@ function Remove-AzApplicationInsightsAnnotation { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityComponent', Mandatory)] [Alias('AnnotationId')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -85,9 +100,14 @@ param( [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='DeleteViaIdentityComponent', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${ComponentInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -150,14 +170,16 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Delete = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_Delete'; DeleteViaIdentity = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_DeleteViaIdentity'; + DeleteViaIdentityComponent = 'Az.ApplicationInsights.private\Remove-AzApplicationInsightsAnnotation_DeleteViaIdentityComponent'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -166,6 +188,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsights.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsights.ps1 index 57175024f560..2515140612bd 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsights.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsights.ps1 @@ -16,10 +16,10 @@ <# .Synopsis -Creates (or updates) an Application Insights component. +Update (or update 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. +Update (or update an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Example {{ Add code here }} @@ -27,39 +27,39 @@ Note: You cannot specify a different value for InstrumentationKey nor AppId in t {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. INSIGHTPROPERTY : An Application Insights component definition. - Location : Resource location 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. + [Location ]: Resource location [Tag ]: Resource tags [(Any) ]: This indicates any property can be added to this object. - [ApplicationType ]: Type of application being monitored. + [ApplicationType ]: Type of application being monitored. [DisableIPMasking ]: Disable IP masking. [DisableLocalAuth ]: Disable Non-AAD based Auth. [Etag ]: Resource etag - [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 ]: 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. [ForceCustomerStorageForProfiler ]: Force users to create their own storage account for profiler and debugger. - [HockeyAppId ]: The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. + [HockeyAppId ]: The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. Please visit external url https://aka.ms/ewjuel to get more information. [ImmediatePurgeDataOn30Day ]: Purge data immediately after 30 days. - [IngestionMode ]: Indicates the flow of the ingestion. - [PublicNetworkAccessForIngestion ]: The network access type for accessing Application Insights ingestion. - [PublicNetworkAccessForQuery ]: The network access type for accessing Application Insights query. - [RequestSource ]: Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. + [IngestionMode ]: Indicates the flow of the ingestion. + [PublicNetworkAccessForIngestion ]: The network access type for accessing Application Insights ingestion. + [PublicNetworkAccessForQuery ]: The network access type for accessing Application Insights query. + [RequestSource ]: Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'. [RetentionInDay ]: Retention period in days. - [SamplingPercentage ]: Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. + [SamplingPercentage ]: Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. Please visit external url https://aka.ms/sl0yqd to get more information. [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. .Link https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsights #> function Set-AzApplicationInsights { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -85,9 +85,8 @@ param( [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent] # An Application Insights component definition. - # To construct, see NOTES section for INSIGHTPROPERTY properties and create a hash table. ${InsightProperty}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -104,9 +103,9 @@ param( ${Location}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("web", "other")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType] + [System.String] # Type of application being monitored. ${ApplicationType}, @@ -129,9 +128,9 @@ param( ${Etag}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Bluefield")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType] + [System.String] # 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}, @@ -146,6 +145,7 @@ param( [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. + # Please visit external url https://aka.ms/ewjuel to get more information. ${HockeyAppId}, [Parameter(ParameterSetName='UpdateExpanded')] @@ -155,30 +155,30 @@ param( ${ImmediatePurgeDataOn30Day}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode] + [System.String] # Indicates the flow of the ingestion. ${IngestionMode}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights ingestion. ${PublicNetworkAccessForIngestion}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType] + [System.String] # The network access type for accessing Application Insights query. ${PublicNetworkAccessForQuery}, [Parameter(ParameterSetName='UpdateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("rest")] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource] + [System.String] # Describes what tool created this Application Insights component. # Customers using this API should set this to the default 'rest'. ${RequestSource}, @@ -193,11 +193,12 @@ param( [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. + # Please visit external url https://aka.ms/sl0yqd to get more information. ${SamplingPercentage}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -210,6 +211,18 @@ param( # Applications from older versions will not have this property. ${WorkspaceResourceId}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -266,14 +279,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Update = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_Update'; UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Set-AzApplicationInsights_UpdateViaJsonString'; } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -282,6 +298,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsComponentCurrentBillingFeature.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsComponentCurrentBillingFeature.ps1 index 142bcffb9cb6..e62765839ade 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsComponentCurrentBillingFeature.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsComponentCurrentBillingFeature.ps1 @@ -25,16 +25,16 @@ Update current billing features for an Application Insights component. {{ Add code here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. BILLINGFEATURESPROPERTY : An Application Insights component billing features - [CurrentBillingFeature ]: Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + [CurrentBillingFeature >]: Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. [DataVolumeCapCap ]: Daily data volume cap in GB. [DataVolumeCapStopSendNotificationWhenHitCap ]: Do not send a notification email when the daily data volume cap is met. [DataVolumeCapStopSendNotificationWhenHitThreshold ]: Reserved, not used for now. @@ -43,7 +43,7 @@ BILLINGFEATURESPROPERTY : An Appli https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscomponentcurrentbillingfeature #> function Set-AzApplicationInsightsComponentCurrentBillingFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -69,9 +69,8 @@ param( [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures] # An Application Insights component billing features - # To construct, see NOTES section for BILLINGFEATURESPROPERTY properties and create a hash table. ${BillingFeaturesProperty}, [Parameter(ParameterSetName='UpdateExpanded')] @@ -106,6 +105,18 @@ param( # Reserved, not used for now. ${DataVolumeCapWarningThreshold}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -162,14 +173,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Update = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_Update'; UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaJsonString'; } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -178,6 +192,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsContinuousExport.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsContinuousExport.ps1 index c509bc58bea7..8512c8feddb5 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsContinuousExport.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Set-AzApplicationInsightsContinuousExport.ps1 @@ -20,6 +20,7 @@ Update the Continuous Export configuration for this export id. .Description Update the Continuous Export configuration for this export id. .Example +$context = "*****" $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" ` @@ -27,9 +28,9 @@ Set-AzApplicationInsightsContinuousExport -ResourceGroupName "testgroup" -Name " -StorageSASUri $sasuri -DestinationType Blob .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration .Notes COMPLEX PARAMETER PROPERTIES @@ -49,7 +50,7 @@ EXPORTPROPERTY : An Application Insi https://learn.microsoft.com/powershell/module/az.applicationinsights/set-azapplicationinsightscontinuousexport #> function Set-AzApplicationInsightsContinuousExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportConfiguration])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -82,9 +83,8 @@ param( [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest] # An Application Insights component Continuous Export configuration request definition. - # To construct, see NOTES section for EXPORTPROPERTY properties and create a hash table. ${ExportProperty}, [Parameter(ParameterSetName='UpdateExpanded')] @@ -144,6 +144,18 @@ param( # It must grant write permission. ${StorageSASUri}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -200,14 +212,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Update = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_Update'; UpdateExpanded = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Set-AzApplicationInsightsContinuousExport_UpdateViaJsonString'; } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -216,6 +231,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentCurrentBillingFeature.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentCurrentBillingFeature.ps1 new file mode 100644 index 000000000000..fae4c7bc2449 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentCurrentBillingFeature.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# 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 }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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. + +BILLINGFEATURESPROPERTY : An Application Insights component billing features + [CurrentBillingFeature >]: Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. + [DataVolumeCapCap ]: Daily data volume cap in GB. + [DataVolumeCapStopSendNotificationWhenHitCap ]: Do not send a notification email when the daily data volume cap is met. + [DataVolumeCapStopSendNotificationWhenHitThreshold ]: Reserved, not used for now. + [DataVolumeCapWarningThreshold ]: Reserved, not used for now. + +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. + [RevisionId ]: The id of the workbook's revision. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightscomponentcurrentbillingfeature +#> +function Update-AzApplicationInsightsComponentCurrentBillingFeature { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Update', Mandatory)] + [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='Update', 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(ParameterSetName='Update')] + [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='UpdateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures] + # An Application Insights component billing features + ${BillingFeaturesProperty}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [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(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Single] + # Daily data volume cap in GB. + ${DataVolumeCap}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [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(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Reserved, not used for now. + ${DataVolumeCapStopSendNotificationWhenHitThreshold}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [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 DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $mapping = @{ + Update = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentCurrentBillingFeature_Update'; + UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentCurrentBillingFeature_UpdateExpanded'; + UpdateViaIdentity = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentity'; + UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentCurrentBillingFeature_UpdateViaIdentityExpanded'; + } + if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $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/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentTag.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentTag.ps1 index 0a018112a712..f2aba9fb27ed 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentTag.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/internal/Update-AzApplicationInsightsComponentTag.ps1 @@ -16,22 +16,22 @@ <# .Synopsis -Updates an existing component's tags. -To update other fields use the CreateOrUpdate method. +Update 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. +Update 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.Api202002.ITagsResource .Inputs Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsIdentity +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent +Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent .Notes COMPLEX PARAMETER PROPERTIES @@ -51,18 +51,20 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [ResourceName ]: The name of the Application Insights component resource. [RevisionId ]: The id of the workbook's revision. - [StorageType ]: The type of the Application Insights component data source for the linked storage account. + [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://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsightscomponenttag #> function Update-AzApplicationInsightsComponentTag { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponent])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ApplicationInsightsComponentName', 'ComponentName')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] @@ -71,6 +73,8 @@ param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [System.String] # The name of the resource group. @@ -79,6 +83,8 @@ param( [Parameter(ParameterSetName='Update')] [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -90,25 +96,35 @@ param( [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='Update', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResource] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResource] # A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - # To construct, see NOTES section for COMPONENTTAG properties and create a hash table. ${ComponentTag}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ITagsResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITagsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -165,16 +181,19 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Update = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_Update'; UpdateExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateExpanded'; UpdateViaIdentity = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ApplicationInsights.private\Update-AzApplicationInsightsComponentTag_UpdateViaJsonString'; } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -183,6 +202,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/test-module.ps1 b/generated/ApplicationInsights/ApplicationInsights.Autorest/test-module.ps1 index c30d3a4568f8..0d1c6d286d5d 100644 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/test-module.ps1 +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/test-module.ps1 @@ -12,17 +12,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +param([switch]$NotIsolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) $ErrorActionPreference = 'Stop' -if(-not $Isolated) +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' if ($PSBoundParameters.ContainsKey("TestName")) { $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," } $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -34,7 +34,7 @@ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and $ProgressPreference = 'SilentlyContinue' $baseName = $PSScriptRoot.BaseName $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) -. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule . ("$PSScriptRoot\test\utils.ps1") if ($requireResourceModule) @@ -95,4 +95,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.format.ps1xml b/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.format.ps1xml index b113db7a3a7a..13064e3d2edf 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.format.ps1xml +++ b/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.format.ps1xml @@ -2,33 +2,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties#Multiple - - - - - - - + - ActivityLogAlertName - - - ResourceGroupName - - - SubscriptionId + Item @@ -36,21 +24,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertIdentity - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertIdentity#Multiple - + + + + + + + - Item + ActivityLogAlertName + + + ResourceGroupName + + + SubscriptionId @@ -58,9 +58,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource#Multiple @@ -92,15 +92,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition#Multiple - - - @@ -111,9 +108,6 @@ - - ContainsAny - Equal @@ -126,15 +120,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition#Multiple - - - @@ -145,9 +136,6 @@ - - ContainsAny - Equal @@ -160,9 +148,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleList + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleList + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList#Multiple @@ -182,9 +170,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags#Multiple @@ -204,9 +192,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties#Multiple @@ -226,9 +214,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties#Multiple @@ -238,9 +226,6 @@ - - - @@ -251,18 +236,15 @@ Enabled - - Scope - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResource#Multiple @@ -288,9 +270,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTags#Multiple @@ -310,9 +292,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse#Multiple diff --git a/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psd1 b/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psd1 index 4a5222955b69..dad3fb48a665 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psd1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.ActivityLogAlert.private.dll' FormatsToProcess = './Az.ActivityLogAlert.format.ps1xml' - FunctionsToExport = 'Get-AzActivityLogAlert', 'New-AzActivityLogAlert', 'New-AzActivityLogAlertActionGroupObject', 'New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject', 'New-AzActivityLogAlertAlertRuleLeafConditionObject', 'Remove-AzActivityLogAlert', 'Update-AzActivityLogAlert', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzActivityLogAlert', 'New-AzActivityLogAlert', 'New-AzActivityLogAlertActionGroupObject', 'New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject', 'New-AzActivityLogAlertAlertRuleLeafConditionObject', 'Remove-AzActivityLogAlert', 'Update-AzActivityLogAlert' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ActivityLogAlert' diff --git a/generated/Monitor/ActivityLogAlert.Autorest/Properties/AssemblyInfo.cs b/generated/Monitor/ActivityLogAlert.Autorest/Properties/AssemblyInfo.cs index b27bed753bbc..986e6c2293f4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ActivityLogAlert")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.2")] -[assembly: System.Reflection.AssemblyVersionAttribute("6.0.2")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.3")] +[assembly: System.Reflection.AssemblyVersionAttribute("6.0.3")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/Monitor/ActivityLogAlert.Autorest/check-dependencies.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/check-dependencies.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/check-dependencies.ps1 @@ -12,13 +12,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) $ErrorActionPreference = 'Stop' -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 index bc04ce1676a7..eaf378a45897 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 @@ -29,7 +29,7 @@ Get-AzActivityLogAlert -ResourceGroupName $rg-name -Name $alert-name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azactivitylogalert #> function Get-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -75,7 +75,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -134,6 +133,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -158,9 +166,7 @@ begin { List = 'Az.ActivityLogAlert.private\Get-AzActivityLogAlert_List'; List1 = 'Az.ActivityLogAlert.private\Get-AzActivityLogAlert_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -174,6 +180,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 index 2065c395fa22..289bb75a27b3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 @@ -30,7 +30,7 @@ $condition3=New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $an New-AzActivityLogAlert -Name $AlertName -ResourceGroupName $ResourceGroupName -Action $actiongroup -Condition @($condition1,$condition2,$condition3) -Location global -Scope $scope .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,18 +42,18 @@ ACTION : The list of the Action Groups. To construct, see NOTES [(Any) ]: This indicates any property can be added to this object. CONDITION : The list of Activity Log Alert rule conditions. To construct, see NOTES section for CONDITIONALLOF properties and create a hash table. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. - [AnyOf ]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [AnyOf >]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azactivitylogalert #> function New-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -77,32 +77,30 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[]] # The list of the Action Groups. # To construct, see NOTES section for ACTIONGROUP properties and create a hash table. - # To construct, see NOTES section for ACTION properties and create a hash table. ${Action}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[]] # The list of Activity Log Alert rule conditions. # To construct, see NOTES section for CONDITIONALLOF properties and create a hash table. - # To construct, see NOTES section for CONDITION properties and create a hash table. ${Condition}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # The location of the resource. # Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'. ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String[]] @@ -111,32 +109,45 @@ param( # This list must include at least one item. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # A description of this Activity Log Alert rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Boolean] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags]))] [System.Collections.Hashtable] # The tags of the resource. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -186,6 +197,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -206,10 +226,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; + CreateViaJsonFilePath = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; + CreateViaJsonString = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -223,6 +243,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertActionGroupObject.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertActionGroupObject.ps1 index c2558162f458..9ec958406679 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertActionGroupObject.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertActionGroupObject.ps1 @@ -23,7 +23,7 @@ Create an in-memory object for ActionGroup. New-AzActivityLogAlertActionGroupObject -Id $ActionGroupResourceId -WebhookProperty @{"sampleWebhookProperty"="SamplePropertyValue"} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup .Notes COMPLEX PARAMETER PROPERTIES @@ -32,10 +32,10 @@ To create the parameters described below, construct a hash table containing the WEBHOOKPROPERTY : the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. [(Any) ]: This indicates any property can be added to this object. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertActionGroupObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertactiongroupobject #> function New-AzActivityLogAlertActionGroupObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -47,10 +47,9 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties] # the dictionary of custom properties to include with the post operation. # These data are appended to the webhook payload. - # To construct, see NOTES section for WEBHOOKPROPERTY properties and create a hash table. ${WebhookProperty} ) @@ -61,6 +60,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -89,6 +91,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject.ps1 index e2398ea252b3..80cf662a567f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject.ps1 @@ -26,28 +26,27 @@ $any=New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incide New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $any .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition .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. ANYOF : An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertalertruleanyoforleafconditionobject #> function New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition[]] # An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - # To construct, see NOTES section for ANYOF properties and create a hash table. ${AnyOf}, [Parameter()] @@ -77,6 +76,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -105,6 +107,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleLeafConditionObject.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleLeafConditionObject.ps1 index 7d68a3af4336..c3285c610e5a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleLeafConditionObject.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleLeafConditionObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for AlertRuleLeafCondition. New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incidentType -Equal Maintenance .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertAlertRuleLeafConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertalertruleleafconditionobject #> function New-AzActivityLogAlertAlertRuleLeafConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -58,6 +58,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -86,6 +89,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 index 7f60f31bcf72..cccc27603ef3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -29,7 +29,7 @@ Get-AzActivityLogAlert -ResourceGroupName $rg-name -Name $alert-name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azactivitylogalert #> function Get-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -75,7 +75,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -134,6 +133,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -158,9 +166,7 @@ begin { List = 'Az.ActivityLogAlert.private\Get-AzActivityLogAlert_List'; List1 = 'Az.ActivityLogAlert.private\Get-AzActivityLogAlert_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -174,6 +180,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -274,7 +283,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -339,6 +347,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -361,9 +378,7 @@ begin { Delete = 'Az.ActivityLogAlert.private\Remove-AzActivityLogAlert_Delete'; DeleteViaIdentity = 'Az.ActivityLogAlert.private\Remove-AzActivityLogAlert_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -377,6 +392,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -436,7 +454,7 @@ $condition3=New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $an New-AzActivityLogAlert -Name $AlertName -ResourceGroupName $ResourceGroupName -Action $actiongroup -Condition @($condition1,$condition2,$condition3) -Location global -Scope $scope .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -448,18 +466,18 @@ ACTION : The list of the Action Groups. To construct, see NOTES [(Any) ]: This indicates any property can be added to this object. CONDITION : The list of Activity Log Alert rule conditions. To construct, see NOTES section for CONDITIONALLOF properties and create a hash table. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. - [AnyOf ]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [AnyOf >]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azactivitylogalert #> function New-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -483,32 +501,30 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[]] # The list of the Action Groups. # To construct, see NOTES section for ACTIONGROUP properties and create a hash table. - # To construct, see NOTES section for ACTION properties and create a hash table. ${Action}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[]] # The list of Activity Log Alert rule conditions. # To construct, see NOTES section for CONDITIONALLOF properties and create a hash table. - # To construct, see NOTES section for CONDITION properties and create a hash table. ${Condition}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # The location of the resource. # Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'. ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String[]] @@ -517,32 +533,45 @@ param( # This list must include at least one item. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # A description of this Activity Log Alert rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Boolean] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags]))] [System.Collections.Hashtable] # The tags of the resource. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -592,6 +621,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -612,10 +650,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; + CreateViaJsonFilePath = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; + CreateViaJsonString = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -629,6 +667,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -681,7 +722,7 @@ Create an in-memory object for ActionGroup. New-AzActivityLogAlertActionGroupObject -Id $ActionGroupResourceId -WebhookProperty @{"sampleWebhookProperty"="SamplePropertyValue"} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup .Notes COMPLEX PARAMETER PROPERTIES @@ -690,10 +731,10 @@ To create the parameters described below, construct a hash table containing the WEBHOOKPROPERTY : the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. [(Any) ]: This indicates any property can be added to this object. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertActionGroupObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertactiongroupobject #> function New-AzActivityLogAlertActionGroupObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -705,10 +746,9 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties] # the dictionary of custom properties to include with the post operation. # These data are appended to the webhook payload. - # To construct, see NOTES section for WEBHOOKPROPERTY properties and create a hash table. ${WebhookProperty} ) @@ -719,6 +759,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -747,6 +790,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -802,28 +848,27 @@ $any=New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incide New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $any .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition .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. ANYOF : An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertalertruleanyoforleafconditionobject #> function New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition[]] # An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - # To construct, see NOTES section for ANYOF properties and create a hash table. ${AnyOf}, [Parameter()] @@ -853,6 +898,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -881,6 +929,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -933,12 +984,12 @@ Create an in-memory object for AlertRuleLeafCondition. New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incidentType -Equal Maintenance .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertAlertRuleLeafConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertalertruleleafconditionobject #> function New-AzActivityLogAlertAlertRuleLeafConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -968,6 +1019,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -996,6 +1050,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1054,13 +1111,13 @@ Update-AzActivityLogAlert -ResourceGroupName $ResourceGroupName -Name $AlertName .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .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 +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ActivityLogAlertName ]: The name of the Activity Log Alert rule. [Id ]: Resource identity path [ResourceGroupName ]: The name of the resource group. The name is case insensitive. @@ -1069,10 +1126,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azactivitylogalert #> function Update-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] @@ -1080,6 +1139,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. @@ -1087,6 +1148,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonString')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -1100,26 +1163,41 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Boolean] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags]))] [System.Collections.Hashtable] # The resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1169,6 +1247,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1189,11 +1276,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; + UpdateViaJsonString = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; + UpdateViaJsonFilePath = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; UpdateViaIdentityExpanded = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonString', 'UpdateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1207,6 +1294,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 index cfd13cc100e7..de7b1bc0f9e5 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 @@ -71,7 +71,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -136,6 +135,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -158,9 +166,7 @@ begin { Delete = 'Az.ActivityLogAlert.private\Remove-AzActivityLogAlert_Delete'; DeleteViaIdentity = 'Az.ActivityLogAlert.private\Remove-AzActivityLogAlert_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -174,6 +180,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 index cd3f4b9fc4fe..a6f0457401c7 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 @@ -29,13 +29,13 @@ Update-AzActivityLogAlert -ResourceGroupName $ResourceGroupName -Name $AlertName .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .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 +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ActivityLogAlertName ]: The name of the Activity Log Alert rule. [Id ]: Resource identity path [ResourceGroupName ]: The name of the resource group. The name is case insensitive. @@ -44,10 +44,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azactivitylogalert #> function Update-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] @@ -55,6 +57,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. @@ -62,6 +66,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonString')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -75,26 +81,41 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Boolean] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags]))] [System.Collections.Hashtable] # The resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -144,6 +165,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -164,11 +194,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; + UpdateViaJsonString = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; + UpdateViaJsonFilePath = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; UpdateViaIdentityExpanded = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonString', 'UpdateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -182,6 +212,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generate-info.json b/generated/Monitor/ActivityLogAlert.Autorest/generate-info.json index ae546df56f8f..290b86f34f0f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generate-info.json +++ b/generated/Monitor/ActivityLogAlert.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "8b11ea6d-f253-44c4-8fa0-a99b6d6e2f72" + "generate_Id": "f24928e3-4b8d-45f5-9497-b8bcb83c2587" } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/Module.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/Module.cs index 6cfed69abb08..6be96ef58afb 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/Module.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/Module.cs @@ -28,12 +28,20 @@ public partial class Module public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + private static bool _init = false; + + private static readonly global::System.Object _initLock = new global::System.Object(); + + private static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,14 +64,11 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } } /// The Name of this module - public string Name => @"Az.ActivityLogAlert"; + public string Name => @"Az.Monitor"; /// The delegate to call when this module is loaded (supporting a commmon module). public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } @@ -75,7 +80,7 @@ public partial class Module public global::System.String ProfileName { get; set; } /// The ResourceID for this module (azure arm). - public string ResourceId => @"Az.ActivityLogAlert"; + public string ResourceId => @"Az.Monitor"; /// The delegate to call in WriteObject to sanitize the output object. public SanitizerDelegate SanitizeOutput { get; set; } @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpP /// Initialization steps performed after the module is loaded. public void Init() { - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); - CustomInit(); + if (_init == false) + { + lock (_initLock) { + if (_init == false) { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + _init = true; + } + } + } } /// Creates the module instance. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/ActivityLogAlert.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/ActivityLogAlert.cs index ab461b51f47f..9a86dd84311a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/ActivityLogAlert.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/ActivityLogAlert.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert public partial class ActivityLogAlert { - /// Create a new Activity Log Alert rule or update an existing one. + /// update a new Activity Log Alert rule or update an existing one. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. @@ -25,10 +25,11 @@ public partial class ActivityLogAlert /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -55,15 +56,15 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ActivityLogAlertsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Create a new Activity Log Alert rule or update an existing one. + /// update a new Activity Log Alert rule or update an existing one. /// /// The Activity Log Alert rule to create or use for the update. /// a delegate that is called when the remote service returns 200 (OK). @@ -72,10 +73,11 @@ public partial class ActivityLogAlert /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -114,111 +116,132 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ActivityLogAlertsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a new Activity Log Alert rule or update an existing one. + /// + /// The Activity Log Alert rule to create or use for the update. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// + /// update a new Activity Log Alert rule or update an existing one. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. - /// The Activity Log Alert rule to create or use for the update. + /// Json string supplied to the ActivityLogAlertsCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(activityLogAlertName),activityLogAlertName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // 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/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Delete an Activity Log Alert rule. + /// update a new Activity Log Alert rule or update an existing one. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the ActivityLogAlertsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsDelete(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -236,77 +259,142 @@ public partial class ActivityLogAlert + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ActivityLogAlertsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ActivityLogAlertsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Delete an Activity Log Alert rule. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a new Activity Log Alert rule or update an existing one. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// The Activity Log Alert rule to create or use for the update. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsDeleteViaIdentity(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.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", global::System.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/activityLogAlerts/{activityLogAlertName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Insights/activityLogAlerts/" - + activityLogAlertName + + global::System.Uri.EscapeDataString(activityLogAlertName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ActivityLogAlertsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ActivityLogAlertsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage 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 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -314,7 +402,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsDelete_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.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -325,6 +413,7 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -332,19 +421,19 @@ public partial class ActivityLogAlert case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -360,17 +449,18 @@ public partial class ActivityLogAlert } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. + /// The Activity Log Alert rule to create or use for the update. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsDelete_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -380,14 +470,17 @@ public partial class ActivityLogAlert await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(activityLogAlertName),activityLogAlertName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get an Activity Log Alert rule. + /// Delete an Activity Log Alert rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -395,7 +488,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsGet(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsDelete(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -417,18 +510,19 @@ public partial class ActivityLogAlert // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Get an Activity Log Alert rule. + /// Delete an Activity Log Alert rule. /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -436,7 +530,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsDeleteViaIdentity(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.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -470,18 +564,19 @@ public partial class ActivityLogAlert // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage 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. @@ -489,7 +584,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsDelete_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.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -500,6 +595,7 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -507,13 +603,19 @@ public partial class ActivityLogAlert case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -529,8 +631,8 @@ public partial class ActivityLogAlert } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -539,7 +641,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsGet_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsDelete_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -552,9 +654,10 @@ public partial class ActivityLogAlert } } - /// Get a list of all Activity Log Alert rules in a resource group. + /// Get an Activity Log Alert rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -563,7 +666,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsGet(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -575,7 +678,8 @@ public partial class ActivityLogAlert + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Insights/activityLogAlerts" + + "/providers/Microsoft.Insights/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -589,11 +693,11 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of all Activity Log Alert rules in a resource group. + /// Get an Activity Log Alert rule. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -603,7 +707,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -611,22 +715,652 @@ public partial class ActivityLogAlert { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", global::System.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/activityLogAlerts'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.Insights/activityLogAlerts" + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get an Activity Log Alert rule. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", global::System.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/activityLogAlerts/{activityLogAlertName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get an Activity Log Alert rule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsGetWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsGet_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(activityLogAlertName),activityLogAlertName); + } + } + + /// Get a list of all Activity Log Alert rules in a resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in 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.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", global::System.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/activityLogAlerts'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", global::System.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/activityLogAlerts'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // 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/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + } + } + + /// Get a list of all Activity Log Alert rules in 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.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionId(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsListBySubscriptionId_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in 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.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionIdViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", 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/activityLogAlerts'"); + } + + // 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/activityLogAlerts" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -638,14 +1372,158 @@ public partial class ActivityLogAlert var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ActivityLogAlertsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsListBySubscriptionId_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionIdViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", 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/activityLogAlerts'"); + } + + // 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/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsListBySubscriptionIdWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a subscription. + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionIdWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsListBySubscriptionIdWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionIdWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -656,7 +1534,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionId_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -667,6 +1545,7 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -674,13 +1553,13 @@ public partial class ActivityLogAlert case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -696,38 +1575,41 @@ public partial class ActivityLogAlert } /// - /// Validation method for method. Call this like the actual call, but + /// Validation method for method. Call this like the actual call, but /// you will get validation events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionId_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); } } - /// Get a list of all Activity Log Alert rules in a subscription. + /// + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. + /// /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// Parameters supplied to the operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionId(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -737,7 +1619,10 @@ public partial class ActivityLogAlert var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.Insights/activityLogAlerts" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -746,26 +1631,35 @@ public partial class ActivityLogAlert // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsListBySubscriptionId_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of all Activity Log Alert rules in a subscription. + /// + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. + /// /// + /// Parameters supplied to the operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionIdViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -773,19 +1667,24 @@ public partial class ActivityLogAlert { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", 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/activityLogAlerts'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.Insights/activityLogAlerts" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -794,101 +1693,145 @@ public partial class ActivityLogAlert // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsListBySubscriptionId_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Parameters supplied to the operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionId_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// Json string supplied to the ActivityLogAlertsUpdate 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.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionId_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + // 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/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and - /// to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. - /// Parameters supplied to the operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the ActivityLogAlertsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -906,85 +1849,134 @@ public partial class ActivityLogAlert + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ActivityLogAlertsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ActivityLogAlertsUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and - /// to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// - /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. /// Parameters supplied to the operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", global::System.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/activityLogAlerts/{activityLogAlertName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Insights/activityLogAlerts/" - + activityLogAlertName + + global::System.Uri.EscapeDataString(activityLogAlertName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ActivityLogAlertsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ActivityLogAlertsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -994,7 +1986,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1005,6 +1997,7 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1012,13 +2005,13 @@ public partial class ActivityLogAlert case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1045,7 +2038,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.PowerShell.cs similarity index 76% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.PowerShell.cs index 767c038ab912..c56a95b9d87f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ActionGroup partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal ActionGroup(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("WebhookProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).WebhookProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties) content.GetValueForProperty("WebhookProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).WebhookProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).WebhookProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties) content.GetValueForProperty("WebhookProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).WebhookProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookPropertiesTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,37 @@ internal ActionGroup(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("WebhookProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).WebhookProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties) content.GetValueForProperty("WebhookProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).WebhookProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).WebhookProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties) content.GetValueForProperty("WebhookProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).WebhookProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookPropertiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ActionGroup(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ActionGroup(content); } @@ -145,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.TypeConverter.cs index 5e232f9a73ec..2a8a7318f7f0 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.cs similarity index 82% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.cs index 386b3671c8fd..5a7c6f5f8b85 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// A pointer to an Azure Action Group. public partial class ActionGroup : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal { /// Backing field for property. @@ -21,13 +21,13 @@ public partial class ActionGroup : public string Id { get => this._id; set => this._id = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties _webhookProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties _webhookProperty; /// /// the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties WebhookProperty { get => (this._webhookProperty = this._webhookProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties()); set => this._webhookProperty = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties WebhookProperty { get => (this._webhookProperty = this._webhookProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties()); set => this._webhookProperty = value; } /// Creates an new instance. public ActionGroup() @@ -43,6 +43,9 @@ public partial interface IActionGroup : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the Action Group. This cannot be null or empty.", SerializedName = @"actionGroupId", PossibleTypes = new [] { typeof(string) })] @@ -53,10 +56,13 @@ public partial interface IActionGroup : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload.", SerializedName = @"webhookProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties WebhookProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties WebhookProperty { get; set; } } /// A pointer to an Azure Action Group. @@ -68,7 +74,7 @@ internal partial interface IActionGroupInternal /// /// the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties WebhookProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties WebhookProperty { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.json.cs similarity index 94% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.json.cs index 362c43786721..8089bd5c9594 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ActionGroup(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert { return; } - {_id = If( json?.PropertyT("actionGroupId"), out var __jsonActionGroupId) ? (string)__jsonActionGroupId : (string)Id;} - {_webhookProperty = If( json?.PropertyT("webhookProperties"), out var __jsonWebhookProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties.FromJson(__jsonWebhookProperties) : WebhookProperty;} + {_id = If( json?.PropertyT("actionGroupId"), out var __jsonActionGroupId) ? (string)__jsonActionGroupId : (string)_id;} + {_webhookProperty = If( json?.PropertyT("webhookProperties"), out var __jsonWebhookProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties.FromJson(__jsonWebhookProperties) : _webhookProperty;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ActionGroup(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.PowerShell.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.PowerShell.cs index 952a5cf1ef38..8851beb4a2b4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ActionGroupWebhookProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -84,7 +84,7 @@ internal ActionGroupWebhookProperties(global::System.Collections.IDictionary con } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,29 +103,29 @@ internal ActionGroupWebhookProperties(global::System.Management.Automation.PSObj } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ActionGroupWebhookProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ActionGroupWebhookProperties(content); } @@ -135,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.TypeConverter.cs index 4b26e195a576..41cbd55b9641 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.cs similarity index 91% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.cs index e44bfb5a142d..658bb5ff64be 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api /// the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. /// public partial class ActionGroupWebhookProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookPropertiesInternal { /// Creates an new instance. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.dictionary.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.dictionary.cs similarity index 96% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.dictionary.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.dictionary.cs index e7af754707c8..6c4cc7e765ac 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.dictionary.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.json.cs similarity index 95% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.json.cs index c201d5999075..41f0798792cd 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -73,13 +73,13 @@ internal ActionGroupWebhookProperties(Microsoft.Azure.PowerShell.Cmdlets.Monitor } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ActionGroupWebhookProperties(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.PowerShell.cs similarity index 78% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.PowerShell.cs index 1c8383440160..4f0eb071607c 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ActionList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,13 +78,13 @@ internal ActionList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,33 @@ internal ActionList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ActionList(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ActionList(content); } @@ -137,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.TypeConverter.cs index 7e7601c01c1f..2a8c694d8d15 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.cs similarity index 69% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.cs index 650c424c8fe1..7dbde1023cfe 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// A list of Activity Log Alert rule actions. public partial class ActionList : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] _actionGroup; + private System.Collections.Generic.List _actionGroup; /// The list of the Action Groups. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get => this._actionGroup; set => this._actionGroup = value; } + public System.Collections.Generic.List ActionGroup { get => this._actionGroup; set => this._actionGroup = value; } /// Creates an new instance. public ActionList() @@ -34,10 +34,13 @@ public partial interface IActionList : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the Action Groups.", SerializedName = @"actionGroups", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + System.Collections.Generic.List ActionGroup { get; set; } } /// A list of Activity Log Alert rule actions. @@ -45,7 +48,7 @@ internal partial interface IActionListInternal { /// The list of the Action Groups. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.json.cs similarity index 91% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.json.cs index 9bf62a834695..9d0d5eca7b15 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ActionList(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert. { return; } - {_actionGroup = If( json?.PropertyT("actionGroups"), out var __jsonActionGroups) ? If( __jsonActionGroups as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup.FromJson(__u) )) ))() : null : ActionGroup;} + {_actionGroup = If( json?.PropertyT("actionGroups"), out var __jsonActionGroups) ? If( __jsonActionGroups as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup.FromJson(__u) )) ))() : null : _actionGroup;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ActionList(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.cs index 56b5c6b07265..6c7772b0da9f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.cs @@ -53,6 +53,9 @@ public partial interface IActivityLogAlertIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Activity Log Alert rule.", SerializedName = @"activityLogAlertName", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IActivityLogAlertIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +75,9 @@ public partial interface IActivityLogAlertIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the resource group. The name is case insensitive.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +86,9 @@ public partial interface IActivityLogAlertIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the target subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.json.cs index 91663a951840..f435c8ec2c1e 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.json.cs @@ -64,10 +64,10 @@ internal ActivityLogAlertIdentity(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Act { return; } - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_activityLogAlertName = If( json?.PropertyT("activityLogAlertName"), out var __jsonActivityLogAlertName) ? (string)__jsonActivityLogAlertName : (string)ActivityLogAlertName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)_resourceGroupName;} + {_activityLogAlertName = If( json?.PropertyT("activityLogAlertName"), out var __jsonActivityLogAlertName) ? (string)__jsonActivityLogAlertName : (string)_activityLogAlertName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.PowerShell.cs similarity index 50% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.PowerShell.cs index 34397279273b..6a37903e6427 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ActivityLogAlertResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,61 +78,61 @@ internal ActivityLogAlertResource(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Condition")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfConditionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfConditionTypeConverter.ConvertFrom); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionListTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ConditionAllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ConditionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ConditionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -147,83 +147,83 @@ internal ActivityLogAlertResource(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Condition")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfConditionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfConditionTypeConverter.ConvertFrom); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionListTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ConditionAllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ConditionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ConditionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ActivityLogAlertResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ActivityLogAlertResource(content); } @@ -233,7 +233,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.TypeConverter.cs index 7bac2632d0b1..600dc599dbd5 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.cs similarity index 63% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.cs index 0a605e03d696..c3c6653a4427 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.cs @@ -3,80 +3,80 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Activity Log Alert rule resource. public partial class ActivityLogAlertResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource __azureResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource __azureResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResource(); /// The list of the Action Groups. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).ActionGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).ActionGroup = value ?? null /* arrayOf */; } /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).ConditionAllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).ConditionAllOf = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConditionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).ConditionAllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).ConditionAllOf = value ?? null /* arrayOf */; } /// A description of this Activity Log Alert rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Description = value ?? null; } /// /// Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of /// its actions will be activated. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Enabled = value ?? default(bool); } + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Enabled = value ?? default(bool); } /// The resource Id. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Id; } /// /// The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always /// be 'global'. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Location = value ?? null; } /// Internal Acessors for Action - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal.Action { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Action = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal.Action { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Action = value ?? null /* model class */; } /// Internal Acessors for Condition - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal.Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Condition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal.Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Condition = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties()); set { {_property = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Type = value ?? null; } /// The name of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties _property; /// The Activity Log Alert rule properties of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] @@ -87,15 +87,15 @@ public partial class ActivityLogAlertResource : /// that fall under one of these prefixes. This list must include at least one item. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public string[] Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } /// The tags of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Tag = value ?? null /* model class */; } /// The type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Type; } /// Creates an new instance. public ActivityLogAlertResource() @@ -118,28 +118,37 @@ public ActivityLogAlertResource() /// An Activity Log Alert rule resource. public partial interface IActivityLogAlertResource : Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource { /// The list of the Action Groups. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the Action Groups.", SerializedName = @"actionGroups", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + System.Collections.Generic.List ActionGroup { get; set; } /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Activity Log Alert rule conditions.", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + System.Collections.Generic.List ConditionAllOf { get; set; } /// A description of this Activity Log Alert rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A description of this Activity Log Alert rule.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -151,6 +160,9 @@ public partial interface IActivityLogAlertResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -162,24 +174,27 @@ public partial interface IActivityLogAlertResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } /// An Activity Log Alert rule resource. internal partial interface IActivityLogAlertResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal { /// The actions that will activate when the condition is met. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Action { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Action { get; set; } /// The list of the Action Groups. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// The condition that will cause this alert to activate. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Condition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Condition { get; set; } /// The list of Activity Log Alert rule conditions. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } + System.Collections.Generic.List ConditionAllOf { get; set; } /// A description of this Activity Log Alert rule. string Description { get; set; } /// @@ -188,12 +203,12 @@ internal partial interface IActivityLogAlertResourceInternal : /// bool? Enabled { get; set; } /// The Activity Log Alert rule properties of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties Property { get; set; } /// /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs /// that fall under one of these prefixes. This list must include at least one item. /// - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.json.cs similarity index 93% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.json.cs index e9f6b6cdb078..a8bf223e7685 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ActivityLogAlertResource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Act { return; } - __azureResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties.FromJson(__jsonProperties) : Property;} + __azureResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ActivityLogAlertResource(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.PowerShell.cs similarity index 77% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.PowerShell.cs index 5d7eee0a1b55..72ed2dab0201 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class AlertRuleAllOfCondition partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -80,13 +80,13 @@ internal AlertRuleAllOfCondition(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)this).AllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)this).AllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)this).AllOf = (System.Collections.Generic.List) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)this).AllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -101,35 +101,35 @@ internal AlertRuleAllOfCondition(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("AllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)this).AllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)this).AllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)this).AllOf = (System.Collections.Generic.List) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)this).AllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleAllOfCondition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleAllOfCondition(content); } @@ -139,7 +139,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.TypeConverter.cs index 536e9f0e2698..4c0a1c6aea94 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.cs similarity index 70% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.cs index cb6cfd165b7e..14016e442798 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api /// An Activity Log Alert rule condition that is met when all its member conditions are met. /// public partial class AlertRuleAllOfCondition : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] _allOf; + private System.Collections.Generic.List _allOf; /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] AllOf { get => this._allOf; set => this._allOf = value; } + public System.Collections.Generic.List AllOf { get => this._allOf; set => this._allOf = value; } /// Creates an new instance. public AlertRuleAllOfCondition() @@ -36,10 +36,13 @@ public partial interface IAlertRuleAllOfCondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Activity Log Alert rule conditions.", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] AllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + System.Collections.Generic.List AllOf { get; set; } } /// An Activity Log Alert rule condition that is met when all its member conditions are met. @@ -47,7 +50,7 @@ internal partial interface IAlertRuleAllOfConditionInternal { /// The list of Activity Log Alert rule conditions. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] AllOf { get; set; } + System.Collections.Generic.List AllOf { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.json.cs similarity index 89% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.json.cs index fb0f12dc2034..183a27f3d70c 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -67,18 +67,18 @@ internal AlertRuleAllOfCondition(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Acti { return; } - {_allOf = If( json?.PropertyT("allOf"), out var __jsonAllOf) ? If( __jsonAllOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition.FromJson(__u) )) ))() : null : AllOf;} + {_allOf = If( json?.PropertyT("allOf"), out var __jsonAllOf) ? If( __jsonAllOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition.FromJson(__u) )) ))() : null : _allOf;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleAllOfCondition(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.PowerShell.cs similarity index 70% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.PowerShell.cs index 3afc7600eea0..50a675617c2b 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -71,7 +71,7 @@ public partial class AlertRuleAnyOfOrLeafCondition partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -86,25 +86,25 @@ internal AlertRuleAnyOfOrLeafCondition(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("AnyOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[]) content.GetValueForProperty("AnyOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf = (System.Collections.Generic.List) content.GetValueForProperty("AnyOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("Field")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); } if (content.Contains("Equal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); } if (content.Contains("ContainsAny")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny = (string[]) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny = (System.Collections.Generic.List) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,47 +119,47 @@ internal AlertRuleAnyOfOrLeafCondition(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("AnyOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[]) content.GetValueForProperty("AnyOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf = (System.Collections.Generic.List) content.GetValueForProperty("AnyOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("Field")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); } if (content.Contains("Equal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); } if (content.Contains("ContainsAny")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny = (string[]) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny = (System.Collections.Generic.List) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleAnyOfOrLeafCondition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleAnyOfOrLeafCondition(content); } @@ -169,7 +169,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs index f21b8882d2af..2a6e0445d193 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.cs similarity index 76% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.cs index fdb3e34a0b64..38689f9c9844 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -17,37 +17,37 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api /// _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ /// public partial class AlertRuleAnyOfOrLeafCondition : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition __alertRuleLeafCondition = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition __alertRuleLeafCondition = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition(); /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[] _anyOf; + private System.Collections.Generic.List _anyOf; /// /// An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[] AnyOf { get => this._anyOf; set => this._anyOf = value; } + public System.Collections.Generic.List AnyOf { get => this._anyOf; set => this._anyOf = value; } /// /// The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition /// is met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string[] ContainsAny { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).ContainsAny; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).ContainsAny = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ContainsAny { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).ContainsAny; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).ContainsAny = value ?? null /* arrayOf */; } /// /// The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Equal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Equal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Equal = value ?? null; } + public string Equal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Equal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Equal = value ?? null; } /// /// The name of the Activity Log event's field that this condition will examine. @@ -55,7 +55,7 @@ public partial class AlertRuleAnyOfOrLeafCondition : /// 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Field { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Field; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Field = value ?? null; } + public string Field { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Field; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Field = value ?? null; } /// Creates an new instance. public AlertRuleAnyOfOrLeafCondition() @@ -84,7 +84,7 @@ public AlertRuleAnyOfOrLeafCondition() /// _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ public partial interface IAlertRuleAnyOfOrLeafCondition : Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition { /// /// An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. @@ -92,10 +92,13 @@ public partial interface IAlertRuleAnyOfOrLeafCondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met.", SerializedName = @"anyOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[] AnyOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition) })] + System.Collections.Generic.List AnyOf { get; set; } } /// An Activity Log Alert rule condition that is met when all its member conditions are met. @@ -106,12 +109,12 @@ public partial interface IAlertRuleAnyOfOrLeafCondition : /// * __AnyOf Condition -__ must contain __only__ 'anyOf' (which is an array of Leaf Conditions). /// _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ internal partial interface IAlertRuleAnyOfOrLeafConditionInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal { /// /// An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[] AnyOf { get; set; } + System.Collections.Generic.List AnyOf { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.json.cs similarity index 89% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.json.cs index a98c191200b2..1478127abc20 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -73,19 +73,19 @@ internal AlertRuleAnyOfOrLeafCondition(Microsoft.Azure.PowerShell.Cmdlets.Monito { return; } - __alertRuleLeafCondition = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition(json); - {_anyOf = If( json?.PropertyT("anyOf"), out var __jsonAnyOf) ? If( __jsonAnyOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition.FromJson(__u) )) ))() : null : AnyOf;} + __alertRuleLeafCondition = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition(json); + {_anyOf = If( json?.PropertyT("anyOf"), out var __jsonAnyOf) ? If( __jsonAnyOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition.FromJson(__u) )) ))() : null : _anyOf;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleAnyOfOrLeafCondition(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.PowerShell.cs similarity index 75% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.PowerShell.cs index 6bcd6c5db88e..9cc252cbd6c4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -66,7 +66,7 @@ public partial class AlertRuleLeafCondition partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -81,21 +81,21 @@ internal AlertRuleLeafCondition(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Field")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); } if (content.Contains("Equal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); } if (content.Contains("ContainsAny")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny = (string[]) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny = (System.Collections.Generic.List) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -110,43 +110,43 @@ internal AlertRuleLeafCondition(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Field")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); } if (content.Contains("Equal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); } if (content.Contains("ContainsAny")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny = (string[]) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny = (System.Collections.Generic.List) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleLeafCondition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleLeafCondition(content); } @@ -156,7 +156,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.TypeConverter.cs index d6938111d784..d5158785d2f7 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.cs similarity index 90% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.cs index 85fbd59ab483..2c80e2e706ea 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -12,19 +12,19 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api /// This condition must contain 'field' and either 'equals' or 'containsAny'. /// public partial class AlertRuleLeafCondition : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal { /// Backing field for property. - private string[] _containsAny; + private System.Collections.Generic.List _containsAny; /// /// The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition /// is met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public string[] ContainsAny { get => this._containsAny; set => this._containsAny = value; } + public System.Collections.Generic.List ContainsAny { get => this._containsAny; set => this._containsAny = value; } /// Backing field for property. private string _equal; @@ -64,16 +64,22 @@ public partial interface IAlertRuleLeafCondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met.", SerializedName = @"containsAny", PossibleTypes = new [] { typeof(string) })] - string[] ContainsAny { get; set; } + System.Collections.Generic.List ContainsAny { get; set; } /// /// The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met.", SerializedName = @"equals", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +92,9 @@ public partial interface IAlertRuleLeafCondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'.", SerializedName = @"field", @@ -102,7 +111,7 @@ internal partial interface IAlertRuleLeafConditionInternal /// The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition /// is met. /// - string[] ContainsAny { get; set; } + System.Collections.Generic.List ContainsAny { get; set; } /// /// The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. /// diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.json.cs similarity index 92% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.json.cs index ef304cbde819..9a6352de20fc 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -68,20 +68,20 @@ internal AlertRuleLeafCondition(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Activ { return; } - {_field = If( json?.PropertyT("field"), out var __jsonField) ? (string)__jsonField : (string)Field;} - {_equal = If( json?.PropertyT("equals"), out var __jsonEquals) ? (string)__jsonEquals : (string)Equal;} - {_containsAny = If( json?.PropertyT("containsAny"), out var __jsonContainsAny) ? If( __jsonContainsAny as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ContainsAny;} + {_field = If( json?.PropertyT("field"), out var __jsonField) ? (string)__jsonField : (string)_field;} + {_equal = If( json?.PropertyT("equals"), out var __jsonEquals) ? (string)__jsonEquals : (string)_equal;} + {_containsAny = If( json?.PropertyT("containsAny"), out var __jsonContainsAny) ? If( __jsonContainsAny as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _containsAny;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleLeafCondition(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.PowerShell.cs similarity index 74% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.PowerShell.cs index e5e635fff8d1..409c592b0ee4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRuleList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal AlertRuleList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,37 @@ internal AlertRuleList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleList(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleList(content); } @@ -145,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.TypeConverter.cs index 5af2708378b2..a6a184e15928 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.cs similarity index 75% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.cs index 367d591d89ef..5070767099a2 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// A list of Activity Log Alert rules. public partial class AlertRuleList : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class AlertRuleList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[] _value; + private System.Collections.Generic.List _value; /// The list of Activity Log Alert rules. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public AlertRuleList() @@ -41,6 +41,9 @@ public partial interface IAlertRuleList : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides the link to retrieve the next set of elements.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IAlertRuleList : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Activity Log Alert rules.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource) })] + System.Collections.Generic.List Value { get; set; } } /// A list of Activity Log Alert rules. @@ -62,7 +68,7 @@ internal partial interface IAlertRuleListInternal /// Provides the link to retrieve the next set of elements. string NextLink { get; set; } /// The list of Activity Log Alert rules. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.json.cs similarity index 90% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.json.cs index 7a10c05381ec..e94386ce5698 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AlertRuleList(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAle { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleList(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.PowerShell.cs similarity index 70% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.PowerShell.cs index 764b5b67e20d..865a2a67af14 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRulePatchObject partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal AlertRulePatchObject(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTagsTypeConverter.ConvertFrom); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,43 +107,41 @@ internal AlertRulePatchObject(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTagsTypeConverter.ConvertFrom); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRulePatchObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRulePatchObject(content); } @@ -153,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.TypeConverter.cs index 96e71155f592..728f40166f3a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.cs similarity index 72% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.cs index 18b4afd8cdac..f4edcdb718ca 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Activity Log Alert rule object for the body of patch operations. public partial class AlertRulePatchObject : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal { /// @@ -18,24 +18,24 @@ public partial class AlertRulePatchObject : /// its actions will be activated. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)Property).Enabled = value ?? default(bool); } + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)Property).Enabled = value ?? default(bool); } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties _property; /// The activity log alert settings for an update operation. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags _tag; /// The resource tags [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags()); set => this._tag = value; } /// Creates an new instance. public AlertRulePatchObject() @@ -54,6 +54,9 @@ public partial interface IAlertRulePatchObject : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -62,10 +65,13 @@ public partial interface IAlertRulePatchObject : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get; set; } } /// An Activity Log Alert rule object for the body of patch operations. @@ -78,9 +84,9 @@ internal partial interface IAlertRulePatchObjectInternal /// bool? Enabled { get; set; } /// The activity log alert settings for an update operation. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties Property { get; set; } /// The resource tags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.json.cs similarity index 93% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.json.cs index 0f4b92e40f64..dba7b6f096d3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AlertRulePatchObject(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Activit { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRulePatchObject(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.PowerShell.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.PowerShell.cs index 9775c1dc03d3..c187d70b966c 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRulePatchObjectTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -82,7 +82,7 @@ internal AlertRulePatchObjectTags(global::System.Collections.IDictionary content } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -101,29 +101,29 @@ internal AlertRulePatchObjectTags(global::System.Management.Automation.PSObject } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRulePatchObjectTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRulePatchObjectTags(content); } @@ -133,7 +133,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.TypeConverter.cs index 76454ae17fcf..7e5a02bc09cb 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.cs similarity index 90% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.cs index b38ce8711f04..565dbd9390eb 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// The resource tags public partial class AlertRulePatchObjectTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTagsInternal { /// Creates an new instance. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.dictionary.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.dictionary.cs similarity index 96% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.dictionary.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.dictionary.cs index eda27721dcbf..bbba93208de3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.dictionary.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.json.cs similarity index 95% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.json.cs index 8246e249bd68..cd5ed8318059 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -71,13 +71,13 @@ internal AlertRulePatchObjectTags(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Act } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRulePatchObjectTags(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.PowerShell.cs similarity index 82% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.PowerShell.cs index a1bbae4152dc..82756482f129 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRulePatchProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,13 +78,13 @@ internal AlertRulePatchProperties(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,35 @@ internal AlertRulePatchProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRulePatchProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRulePatchProperties(content); } @@ -137,7 +137,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.TypeConverter.cs index 2ee2560a3b9b..72a8633911d1 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.cs similarity index 94% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.cs index 12d630f8f515..e40964f818ae 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Activity Log Alert rule properties for patch operations. public partial class AlertRulePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal { /// Backing field for property. @@ -40,6 +40,9 @@ public partial interface IAlertRulePatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.json.cs similarity index 94% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.json.cs index 3b44c9aed7b2..f428b86e1059 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AlertRulePatchProperties(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Act { return; } - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRulePatchProperties(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.PowerShell.cs similarity index 57% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.PowerShell.cs index b873f77ac568..0dc25a194f0a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRuleProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,37 +78,37 @@ internal AlertRuleProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Condition")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfConditionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfConditionTypeConverter.ConvertFrom); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionListTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ConditionAllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ConditionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ConditionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -123,59 +123,57 @@ internal AlertRuleProperties(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Condition")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfConditionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfConditionTypeConverter.ConvertFrom); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionListTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ConditionAllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ConditionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ConditionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleProperties(content); } @@ -185,7 +183,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.TypeConverter.cs index 9dc1c9a5d180..93dd5d623caa 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.cs similarity index 69% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.cs index f2eb91582334..91baab8296fc 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.cs @@ -3,37 +3,37 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Azure Activity Log Alert rule. public partial class AlertRuleProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList _action; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList _action; /// The actions that will activate when the condition is met. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionList()); set => this._action = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionList()); set => this._action = value; } /// The list of the Action Groups. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)Action).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)Action).ActionGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)Action).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)Action).ActionGroup = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition _condition; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition _condition; /// The condition that will cause this alert to activate. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Condition { get => (this._condition = this._condition ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfCondition()); set => this._condition = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Condition { get => (this._condition = this._condition ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfCondition()); set => this._condition = value; } /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)Condition).AllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)Condition).AllOf = value ; } + public System.Collections.Generic.List ConditionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)Condition).AllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)Condition).AllOf = value ; } /// Backing field for property. private string _description; @@ -53,20 +53,20 @@ public partial class AlertRuleProperties : public bool? Enabled { get => this._enabled; set => this._enabled = value; } /// Internal Acessors for Action - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal.Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionList()); set { {_action = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal.Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionList()); set { {_action = value;} } } /// Internal Acessors for Condition - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal.Condition { get => (this._condition = this._condition ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfCondition()); set { {_condition = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal.Condition { get => (this._condition = this._condition ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfCondition()); set { {_condition = value;} } } /// Backing field for property. - private string[] _scope; + private System.Collections.Generic.List _scope; /// /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs /// that fall under one of these prefixes. This list must include at least one item. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public string[] Scope { get => this._scope; set => this._scope = value; } + public System.Collections.Generic.List Scope { get => this._scope; set => this._scope = value; } /// Creates an new instance. public AlertRuleProperties() @@ -82,22 +82,31 @@ public partial interface IAlertRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the Action Groups.", SerializedName = @"actionGroups", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + System.Collections.Generic.List ActionGroup { get; set; } /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Activity Log Alert rule conditions.", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + System.Collections.Generic.List ConditionAllOf { get; set; } /// A description of this Activity Log Alert rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A description of this Activity Log Alert rule.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +118,9 @@ public partial interface IAlertRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -120,10 +132,13 @@ public partial interface IAlertRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } /// An Azure Activity Log Alert rule. @@ -131,13 +146,13 @@ internal partial interface IAlertRulePropertiesInternal { /// The actions that will activate when the condition is met. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Action { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Action { get; set; } /// The list of the Action Groups. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// The condition that will cause this alert to activate. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Condition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Condition { get; set; } /// The list of Activity Log Alert rule conditions. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } + System.Collections.Generic.List ConditionAllOf { get; set; } /// A description of this Activity Log Alert rule. string Description { get; set; } /// @@ -149,7 +164,7 @@ internal partial interface IAlertRulePropertiesInternal /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs /// that fall under one of these prefixes. This list must include at least one item. /// - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.json.cs similarity index 90% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.json.cs index 25428d1224c7..fa458d8f287e 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,22 +65,22 @@ internal AlertRuleProperties(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Activity { return; } - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfCondition.FromJson(__jsonCondition) : Condition;} - {_action = If( json?.PropertyT("actions"), out var __jsonActions) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionList.FromJson(__jsonActions) : Action;} - {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Scope;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfCondition.FromJson(__jsonCondition) : _condition;} + {_action = If( json?.PropertyT("actions"), out var __jsonActions) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionList.FromJson(__jsonActions) : _action;} + {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _scope;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleProperties(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.PowerShell.cs similarity index 69% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.PowerShell.cs index 89d9946ddcfa..2ce95afb60fb 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,29 +78,29 @@ internal AzureResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTagsTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -115,51 +115,49 @@ internal AzureResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureResource(content); } @@ -169,7 +167,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.TypeConverter.cs index ce9754e30c38..3e5c96f0e1b4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.cs similarity index 85% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.cs index 1e7e322f4f3c..94aca1123004 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Azure resource object. public partial class AzureResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal { /// Backing field for property. @@ -31,13 +31,13 @@ public partial class AzureResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -47,11 +47,11 @@ public partial class AzureResource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags _tag; /// The tags of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -74,6 +74,9 @@ public partial interface IAzureResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +88,9 @@ public partial interface IAzureResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +99,9 @@ public partial interface IAzureResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -101,14 +110,20 @@ public partial interface IAzureResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tags of the resource.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get; set; } /// The type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -129,7 +144,7 @@ internal partial interface IAzureResourceInternal /// The name of the resource. string Name { get; set; } /// The tags of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get; set; } /// The type of the resource. string Type { get; set; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.json.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.json.cs index 9eb7f6418719..13c86fe0afbe 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,22 +65,22 @@ internal AzureResource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAle { 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.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTags.FromJson(__jsonTags) : Tag;} + {_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.Monitor.ActivityLogAlert.Models.AzureResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AzureResource(json) : null; } @@ -104,19 +104,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); AfterToJson(ref container); return container; diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.PowerShell.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.PowerShell.cs index af387ea36bfa..d0a70ef9f19b 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureResourceTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -82,7 +82,7 @@ internal AzureResourceTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -101,29 +101,27 @@ internal AzureResourceTags(global::System.Management.Automation.PSObject content } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureResourceTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureResourceTags(content); } @@ -133,7 +131,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.TypeConverter.cs index b34757a77e0e..7aa605cf31f6 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.cs similarity index 91% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.cs index a71c7826eb33..74351f0d3619 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// The tags of the resource. public partial class AzureResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTagsInternal { /// Creates an new instance. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.dictionary.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.dictionary.cs similarity index 96% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.dictionary.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.dictionary.cs index 2c2deabe1ecc..f7fcb953c50d 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.dictionary.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.json.cs similarity index 96% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.json.cs index 913d7477e25f..eace8e19ef49 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -71,13 +71,13 @@ internal AzureResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLo } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AzureResourceTags(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 79% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 856a168cbf56..0f6c36d9daf2 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class ErrorResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponse(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,17 +104,17 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,11 +129,11 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,7 +143,7 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 3a6bbc66006a..57ecfa245484 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.cs index 5230946a87b0..1e6effd0dabc 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// The error response. public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal { /// Backing field for property. @@ -28,10 +28,10 @@ public partial class ErrorResponse : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal.Message { get => this._message; set { {_message = value;} } } /// Creates an new instance. public ErrorResponse() @@ -47,6 +47,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -55,6 +58,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.json.cs index 305deb8c1476..43f49f3d4637 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAle { 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;} + {_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.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_Get.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_Get.cs index 858f19f10363..eb99410b8c79 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_Get.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Get an Activity Log Alert rule. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzActivityLogAlert_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf and Scope will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Get an Activity Log Alert rule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class GetAzActivityLogAlert_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzActivityLogAlert_Get : global::System.Management.Autom /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzActivityLogAlert_Get : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +114,7 @@ public partial class GetAzActivityLogAlert_Get : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -140,7 +160,8 @@ public partial class GetAzActivityLogAlert_Get : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzActivityLogAlert_Get : global::System.Management.Autom /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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); + 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) @@ -189,6 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -210,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzActivityLogAlert_Get() { @@ -261,8 +287,33 @@ public GetAzActivityLogAlert_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -315,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -374,12 +425,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -396,15 +447,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 } }); @@ -414,12 +465,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -431,8 +482,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_GetViaIdentity.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_GetViaIdentity.cs index 6d26f382301c..d12fa7500182 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_GetViaIdentity.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Get an Activity Log Alert rule. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzActivityLogAlert_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf and Scope will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Get an Activity Log Alert rule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class GetAzActivityLogAlert_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzActivityLogAlert_GetViaIdentity : global::System.Manag /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzActivityLogAlert_GetViaIdentity : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +107,7 @@ public partial class GetAzActivityLogAlert_GetViaIdentity : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -110,24 +130,24 @@ public partial class GetAzActivityLogAlert_GetViaIdentity : global::System.Manag /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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); + 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) @@ -150,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzActivityLogAlert_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzActivityLogAlert_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -352,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,7 +424,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 } @@ -392,12 +442,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List.cs index 16e1ce0e9894..1b3ad6d74b21 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Get a list of all Activity Log Alert rules in a subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets /// [OpenAPI] ListBySubscriptionId=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzActivityLogAlert_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf and Scope will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Get a list of all Activity Log Alert rules in a subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts", ApiVersion = "2020-10-01")] public partial class GetAzActivityLogAlert_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzActivityLogAlert_List : global::System.Management.Auto /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzActivityLogAlert_List : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -85,7 +105,7 @@ public partial class GetAzActivityLogAlert_List : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -117,7 +137,8 @@ public partial class GetAzActivityLogAlert_List : global::System.Management.Auto [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzActivityLogAlert_List : global::System.Management.Auto /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList /// 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); + 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) @@ -166,6 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzActivityLogAlert_List() { @@ -238,8 +264,33 @@ public GetAzActivityLogAlert_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -292,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + 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 } }); @@ -351,12 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -373,15 +424,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 { SubscriptionId=SubscriptionId }) + 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 } }); @@ -391,12 +442,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List1.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List1.cs index de8d0aa7f3c2..fed0ed7f6e57 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List1.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Get a list of all Activity Log Alert rules in a resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzActivityLogAlert_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf and Scope will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Get a list of all Activity Log Alert rules in a resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts", ApiVersion = "2020-10-01")] public partial class GetAzActivityLogAlert_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzActivityLogAlert_List1 : global::System.Management.Aut /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzActivityLogAlert_List1 : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -85,7 +105,7 @@ public partial class GetAzActivityLogAlert_List1 : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -131,7 +151,8 @@ public partial class GetAzActivityLogAlert_List1 : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzActivityLogAlert_List1 : global::System.Management.Aut /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList /// 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); + 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) @@ -180,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzActivityLogAlert_List1() { @@ -252,8 +278,33 @@ public GetAzActivityLogAlert_List1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + 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 } }); @@ -405,12 +456,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -422,15 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateExpanded.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateExpanded.cs index ab3e5e54cefb..ae4b426830d3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateExpanded.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateExpanded.cs @@ -6,21 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; - /// Create a new Activity Log Alert rule or update an existing one. + /// create a new Activity Log Alert rule or create an existing one. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActivityLogAlert_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf, Scope and AnyOf will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Create a new Activity Log Alert rule or update an existing one.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"create a new Activity Log Alert rule or create an existing one.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,13 +34,25 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag private string __processRecordId; /// An Activity Log Alert rule resource. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource _activityLogAlertRuleBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource _activityLogAlertRuleBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// The list of the Action Groups. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of the Action Groups.")] @@ -48,15 +62,17 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"The list of the Action Groups.", SerializedName = @"actionGroups", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup) })] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ParameterBreakingChange("ActionGroup", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] Action { get => _activityLogAlertRuleBody.ActionGroup ?? null /* arrayOf */; set => _activityLogAlertRuleBody.ActionGroup = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[] Action { get => _activityLogAlertRuleBody.ActionGroup?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.ActionGroup = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -69,9 +85,8 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"The list of Activity Log Alert rule conditions.", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) })] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ParameterBreakingChange("ConditionAllOf", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] Condition { get => _activityLogAlertRuleBody.ConditionAllOf ?? null /* arrayOf */; set => _activityLogAlertRuleBody.ConditionAllOf = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[] Condition { get => _activityLogAlertRuleBody.ConditionAllOf?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.ConditionAllOf = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -108,6 +123,9 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter Enabled { get => _activityLogAlertRuleBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _activityLogAlertRuleBody.Enabled = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -163,7 +181,7 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -208,8 +226,7 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag Description = @"A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ParameterBreakingChange("Scope", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public string[] Scope { get => _activityLogAlertRuleBody.Scope ?? null /* arrayOf */; set => _activityLogAlertRuleBody.Scope = value; } + public string[] Scope { get => _activityLogAlertRuleBody.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _subscriptionId; @@ -225,7 +242,8 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -238,44 +256,44 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"The tags of the resource.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get => _activityLogAlertRuleBody.Tag ?? null /* object */; set => _activityLogAlertRuleBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get => _activityLogAlertRuleBody.Tag ?? null /* object */; set => _activityLogAlertRuleBody.Tag = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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); + 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) @@ -298,6 +316,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -362,8 +385,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -373,7 +421,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzActivityLogAlert_CreateExpanded() { @@ -427,7 +475,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -440,12 +488,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ActivityLogAlertsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _activityLogAlertRuleBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.ActivityLogAlertsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _activityLogAlertRuleBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=_activityLogAlertRuleBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -481,12 +529,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -498,8 +546,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -507,12 +573,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -529,15 +595,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_activityLogAlertRuleBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_activityLogAlertRuleBody }) + 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 } }); @@ -547,12 +613,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -564,8 +630,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaIdentityExpanded.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..e1845b2c106b --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaIdentityExpanded.cs @@ -0,0 +1,636 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// create a new Activity Log Alert rule or create an existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActivityLogAlert_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"create a new Activity Log Alert rule or create an existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + public partial class NewAzActivityLogAlert_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// An Activity Log Alert rule resource. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource _activityLogAlertRuleBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// The list of the Action Groups. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of the Action Groups.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of the Action Groups.", + SerializedName = @"actionGroups", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[] Action { get => _activityLogAlertRuleBody.ActionGroup?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.ActionGroup = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; + + /// The list of Activity Log Alert rule conditions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Activity Log Alert rule conditions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Activity Log Alert rule conditions.", + SerializedName = @"allOf", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[] Condition { get => _activityLogAlertRuleBody.ConditionAllOf?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.ConditionAllOf = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// A description of this Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A description of this Activity Log Alert rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A description of this Activity Log Alert rule.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _activityLogAlertRuleBody.Description ?? null; set => _activityLogAlertRuleBody.Description = value; } + + /// + /// Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of + /// its actions will be activated. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter Enabled { get => _activityLogAlertRuleBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _activityLogAlertRuleBody.Enabled = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity 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; } } + + /// + /// The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always + /// be 'global'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _activityLogAlertRuleBody.Location ?? null; set => _activityLogAlertRuleBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs + /// that fall under one of these prefixes. This list must include at least one item. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.", + SerializedName = @"scopes", + PossibleTypes = new [] { typeof(string) })] + public string[] Scope { get => _activityLogAlertRuleBody.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get => _activityLogAlertRuleBody.Tag ?? null /* object */; set => _activityLogAlertRuleBody.Tag = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzActivityLogAlert_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ActivityLogAlertsCreateOrUpdateViaIdentity(InputObject.Id, _activityLogAlertRuleBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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.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.ActivityLogAlertName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ActivityLogAlertName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ActivityLogAlertsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ActivityLogAlertName ?? null, _activityLogAlertRuleBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonFilePath.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..af9747ac0d82 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonFilePath.cs @@ -0,0 +1,579 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// create a new Activity Log Alert rule or create an existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActivityLogAlert_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"create a new Activity Log Alert rule or create an existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.NotSuggestDefaultParameterSet] + public partial class NewAzActivityLogAlert_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Activity Log Alert rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Activity Log Alert rule.", + SerializedName = @"activityLogAlertName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ActivityLogAlertName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzActivityLogAlert_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ActivityLogAlertsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonString.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonString.cs new file mode 100644 index 000000000000..a131509f067a --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonString.cs @@ -0,0 +1,577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// create a new Activity Log Alert rule or create an existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActivityLogAlert_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"create a new Activity Log Alert rule or create an existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.NotSuggestDefaultParameterSet] + public partial class NewAzActivityLogAlert_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Activity Log Alert rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Activity Log Alert rule.", + SerializedName = @"activityLogAlertName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ActivityLogAlertName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzActivityLogAlert_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ActivityLogAlertsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_Delete.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_Delete.cs index f23811541c58..bffb7c400ca0 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_Delete.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Delete an Activity Log Alert rule. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class RemoveAzActivityLogAlert_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzActivityLogAlert_Delete : global::System.Management /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzActivityLogAlert_Delete : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +121,7 @@ public partial class RemoveAzActivityLogAlert_Delete : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -146,7 +167,8 @@ public partial class RemoveAzActivityLogAlert_Delete : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -155,12 +177,12 @@ public partial class RemoveAzActivityLogAlert_Delete : global::System.Management /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + 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 @@ -203,6 +225,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -267,8 +294,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -324,7 +376,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -342,7 +394,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,7 +407,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzActivityLogAlert_Delete() { @@ -388,12 +440,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,15 +462,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 } }); @@ -443,7 +495,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -467,7 +519,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_DeleteViaIdentity.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_DeleteViaIdentity.cs index 5935a4385c2c..3ee9bd801265 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_DeleteViaIdentity.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Delete an Activity Log Alert rule. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class RemoveAzActivityLogAlert_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzActivityLogAlert_DeleteViaIdentity : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzActivityLogAlert_DeleteViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class RemoveAzActivityLogAlert_DeleteViaIdentity : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -116,12 +137,12 @@ public partial class RemoveAzActivityLogAlert_DeleteViaIdentity : global::System /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + 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 @@ -164,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzActivityLogAlert_DeleteViaIdentity() { @@ -369,12 +420,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -391,7 +442,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 } @@ -424,7 +475,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -448,7 +499,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateExpanded.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateExpanded.cs index b7392cc3e1da..a5705827cdbf 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateExpanded.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateExpanded.cs @@ -6,24 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// - /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and - /// to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzActivityLogAlert_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf, Scope and AnyOf will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrupdate operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,18 +37,33 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma private string __processRecordId; /// An Activity Log Alert rule object for the body of patch operations. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject _activityLogAlertRulePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObject(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject _activityLogAlertRulePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObject(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -74,6 +91,9 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter Enabled { get => _activityLogAlertRulePatchBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _activityLogAlertRulePatchBody.Enabled = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -115,7 +135,7 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -161,7 +181,8 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -174,32 +195,32 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"The resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get => _activityLogAlertRulePatchBody.Tag ?? null /* object */; set => _activityLogAlertRulePatchBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get => _activityLogAlertRulePatchBody.Tag ?? null /* object */; set => _activityLogAlertRulePatchBody.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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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); + 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) @@ -222,6 +243,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -286,8 +312,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -343,7 +394,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -356,12 +407,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ActivityLogAlertsUpdate(SubscriptionId, ResourceGroupName, Name, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline); + await this.Client.ActivityLogAlertsUpdate(SubscriptionId, ResourceGroupName, Name, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=_activityLogAlertRulePatchBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -381,7 +432,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzActivityLogAlert_UpdateExpanded() { @@ -407,12 +458,12 @@ public UpdateAzActivityLogAlert_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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -429,15 +480,15 @@ public UpdateAzActivityLogAlert_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_activityLogAlertRulePatchBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_activityLogAlertRulePatchBody }) + 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 } }); @@ -447,12 +498,12 @@ public UpdateAzActivityLogAlert_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -464,8 +515,26 @@ public UpdateAzActivityLogAlert_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaIdentityExpanded.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaIdentityExpanded.cs index d12a72ff5748..f020e7640535 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaIdentityExpanded.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaIdentityExpanded.cs @@ -6,24 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// - /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and - /// to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzActivityLogAlert_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf, Scope and AnyOf will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrupdate operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,18 +37,33 @@ public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global private string __processRecordId; /// An Activity Log Alert rule object for the body of patch operations. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject _activityLogAlertRulePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObject(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject _activityLogAlertRulePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObject(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -74,6 +91,9 @@ public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter Enabled { get => _activityLogAlertRulePatchBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _activityLogAlertRulePatchBody.Enabled = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -108,7 +128,7 @@ public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -135,32 +155,32 @@ public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"The resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get => _activityLogAlertRulePatchBody.Tag ?? null /* object */; set => _activityLogAlertRulePatchBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get => _activityLogAlertRulePatchBody.Tag ?? null /* object */; set => _activityLogAlertRulePatchBody.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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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); + 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) @@ -183,6 +203,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -247,8 +272,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -304,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +369,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ActivityLogAlertsUpdateViaIdentity(InputObject.Id, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline); + await this.Client.ActivityLogAlertsUpdateViaIdentity(InputObject.Id, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate); } else { @@ -336,13 +386,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ActivityLogAlertName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ActivityLogAlertsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ActivityLogAlertName ?? null, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline); + await this.Client.ActivityLogAlertsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ActivityLogAlertName ?? null, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_activityLogAlertRulePatchBody}) + 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 } }); @@ -362,7 +412,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzActivityLogAlert_UpdateViaIdentityExpanded() { @@ -388,12 +438,12 @@ public UpdateAzActivityLogAlert_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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,15 +460,15 @@ public UpdateAzActivityLogAlert_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_activityLogAlertRulePatchBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 { body=_activityLogAlertRulePatchBody }) + 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 } }); @@ -428,12 +478,12 @@ public UpdateAzActivityLogAlert_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -445,8 +495,26 @@ public UpdateAzActivityLogAlert_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonFilePath.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..80995f6ae6cd --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonFilePath.cs @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzActivityLogAlert_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrupdate operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.NotSuggestDefaultParameterSet] + public partial class UpdateAzActivityLogAlert_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Activity Log Alert rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Activity Log Alert rule.", + SerializedName = @"activityLogAlertName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ActivityLogAlertName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ActivityLogAlertsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzActivityLogAlert_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonString.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonString.cs new file mode 100644 index 000000000000..db96eaaf8cb2 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonString.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzActivityLogAlert_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrupdate operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.NotSuggestDefaultParameterSet] + public partial class UpdateAzActivityLogAlert_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Activity Log Alert rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Activity Log Alert rule.", + SerializedName = @"activityLogAlertName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ActivityLogAlertName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ActivityLogAlertsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzActivityLogAlert_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..6633d4b8a3cf --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert +{ + using System; + using System.Collections.Generic; + using System.Text; + + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] + public class ExternalDocsAttribute : Attribute + { + + public string Description { get; } + + public string Url { get; } + + public ExternalDocsAttribute(string url) + { + Url = url; + } + + public ExternalDocsAttribute(string url, string description) + { + Url = url; + Description = description; + } + } +} diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..f2b6e798cd83 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 9a7e957256c8..26b0a5cfde75 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -20,11 +20,13 @@ public class ExportFormatPs1xml : PSCmdlet public string FilePath { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @"Id,Type"; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 7458967688e3..d104e6d82482 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -24,7 +24,7 @@ public class ExportModelSurface : PSCmdlet public bool UseExpandedFormat { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index b731d088a708..537531e3b3b9 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -70,9 +70,8 @@ protected override void ProcessRecord() var variantGroups = profileGroups.SelectMany(pg => pg.Variants .GroupBy(v => new { v.CmdletName, v.IsInternal }) .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), - Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) .ToArray(); - var license = new StringBuilder(); license.Append(@" # ---------------------------------------------------------------------------------- @@ -114,6 +113,7 @@ protected override void ProcessRecord() sb.Append("param("); sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) { var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 8dd9989f3d27..d0b8f97a512a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() } else { - var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList(); sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); } @@ -148,8 +148,10 @@ protected override void ProcessRecord() } else { - var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); - sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); + if (!String.IsNullOrEmpty(aliasesList)) { + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } } // CmdletsToExport diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 56f360de179f..0c5911560b0e 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 78da6d6005c8..8b83d669d79f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -94,7 +94,7 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index e66ca7dd5d77..2a19ee8ae3d6 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -36,14 +36,23 @@ internal class PsHelpInfo public object Role { get; } public string NonTerminatingErrors { get; } + public static string CapitalizeFirstLetter(string text) + { + if (string.IsNullOrEmpty(text)) + return text; + + return char.ToUpper(text[0]) + text.Substring(1); + } + public PsHelpInfo(PSObject helpObject = null) { helpObject = helpObject ?? new PSObject(); CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); ModuleName = helpObject.GetProperty("ModuleName"); - Synopsis = helpObject.GetProperty("Synopsis"); + Synopsis = CapitalizeFirstLetter(helpObject.GetProperty("Synopsis")); Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + Description = CapitalizeFirstLetter(Description); AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); Category = helpObject.GetProperty("Category"); HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index ace2839af38e..c3886761afad 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -31,7 +31,7 @@ internal class MarkdownHelpInfo public string[] Inputs { get; } public string[] Outputs { get; } public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } - public string[] RelatedLinks { get; } + public MarkdownRelatedLinkInfo[] RelatedLinks { get; } public bool SupportsShouldProcess { get; } public bool SupportsPaging { get; } @@ -67,7 +67,11 @@ public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; OnlineVersion = commentInfo.OnlineVersion; - RelatedLinks = commentInfo.RelatedLinks; + + var relatedLinkLists = new List(); + relatedLinkLists.AddRange(commentInfo.RelatedLinks?.Select(link => new MarkdownRelatedLinkInfo(link))); + relatedLinkLists.AddRange(variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Distinct()?.Select(link => new MarkdownRelatedLinkInfo(link.Url, link.Description))); + RelatedLinks = relatedLinkLists?.ToArray(); SupportsShouldProcess = variantGroup.SupportsShouldProcess; SupportsPaging = variantGroup.SupportsPaging; @@ -218,14 +222,45 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param } } + internal class MarkdownRelatedLinkInfo + { + public string Url { get; } + public string Description { get; } + + public MarkdownRelatedLinkInfo(string url) + { + Url = url; + } + + public MarkdownRelatedLinkInfo(string url, string description) + { + Url = url; + Description = description; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(Description)) + { + return Url; + } + else + { + return $@"[{Description}]({Url})"; + + } + + } + } + internal static class MarkdownTypesExtensions { 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 }}", $@"{{{{ 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 }}"), + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index b05c10ab6a2f..2ecc57b4d607 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 82a9da9111a9..c494dbdf37c5 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"Az.Monitor";} + public string RootModuleName { get => @"Az.Monitor"; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -374,6 +392,7 @@ public CommentInfo(VariantGroup variantGroup) var helpInfo = variantGroup.HelpInfo; Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() ?? helpInfo.Description.EmptyIfNull(); + Description = PsHelpInfo.CapitalizeFirstLetter(Description); // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; Synopsis = synopsis.NullIfEmpty() ?? Description; @@ -391,6 +410,9 @@ public CommentInfo(VariantGroup variantGroup) 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(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +442,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +465,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +513,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +542,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 15963896560b..f5e68930111a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -22,6 +22,11 @@ public class DoNotExportAttribute : Attribute { } + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class ModelCmdletAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Class)] public class InternalExportAttribute : Attribute { @@ -55,6 +60,11 @@ public class HttpPathAttribute : Attribute public string ApiVersion { get; set; } } + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -109,6 +119,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 83627d4e4587..f039e31e002c 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Po { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsHelpers.cs index cc0c40124316..01b1c59accd7 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -67,7 +67,7 @@ public static IEnumerable GetScriptHelpInfo(params string[] modulePath public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) { - var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" )); return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) @@ -88,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Context.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..18afb39f0c9e --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Context.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParameters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ActivityLogAlert Client { get; } + } +} diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Events.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Events.cs index f7845c06b74e..dd776f1b4a59 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Events.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Events.cs @@ -22,6 +22,6 @@ public static partial class Events public const string FollowingNextLink = nameof(FollowingNextLink); public const string DelayBeforePolling = nameof(DelayBeforePolling); public const string Polling = nameof(Polling); - + public const string Progress = nameof(Progress); } -} \ No newline at end of file +} diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/ISendAsync.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/ISendAsync.cs index d8c739d6560a..476893fb8d28 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InfoAttribute.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InfoAttribute.cs index 6a777af1b473..509368017d36 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InfoAttribute.cs @@ -11,6 +11,9 @@ public class InfoAttribute : Attribute { public bool Required { get; set; } = false; public bool ReadOnly { get; set; } = false; + public bool Read { get; set; } = true; + public bool Create { get; set; } = true; + public bool Update { get; set; } = true; public Type[] PossibleTypes { get; set; } = new Type[0]; public string Description { get; set; } = ""; public string SerializedName { get; set; } = ""; @@ -30,5 +33,6 @@ public class DefaultInfoAttribute : Attribute public string Script { get; set; } = ""; public string Name { get; set; } = ""; public string Description { get; set; } = ""; + public string SetCondition { get; set; } = ""; } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InputHandler.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..a012e7be44de --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InputHandler.cs @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets +{ + public abstract class InputHandler + { + protected InputHandler NextHandler = null; + + public void SetNextHandler(InputHandler nextHandler) + { + this.NextHandler = nextHandler; + } + + public abstract void Process(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/MessageAttribute.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/MessageAttribute.cs index 1ed0d5918f95..3c770058825d 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime public class GenericBreakingChangeAttribute : Attribute { private string _message; - //A dexcription of what the change is about, non mandatory + //A description of what the change is about, non mandatory public string ChangeDescription { get; set; } = null; + //Name of the module that is being deprecated + public string moduleName { get; set; } = String.IsNullOrEmpty(@"Az.Monitor") ? @"Az.ActivityLogAlert" : @"Az.Monitor"; + //The version the change is effective from, non mandatory public string DeprecateByVersion { get; } public string DeprecateByAzVersion { get; } @@ -82,7 +85,7 @@ public void PrintCustomAttributeInfo(Action writeOutput) } writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); - writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.moduleName, this.DeprecateByVersion)); if (OldWay != null && NewWay != null) { @@ -191,11 +194,11 @@ public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this( this.IsEstimatedGaDateSet = true; } } - + public void PrintCustomAttributeInfo(Action writeOutput) { writeOutput(this._message); - + if (IsEstimatedGaDateSet) { writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 749022e25164..57fbf0dc6ed5 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Properties/Resources.resx b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Properties/Resources.resx @@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can -- The change is expected to take effect from version : '{0}' +- The change is expected to take effect in '{0}' from version : '{1}' ```powershell diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/SerializationMode.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/SerializationMode.cs index 683a21976a53..22eab11ce810 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/SerializationMode.cs @@ -9,8 +9,10 @@ public enum SerializationMode { None = 0, IncludeHeaders = 1 << 0, - IncludeReadOnly = 1 << 1, - - IncludeAll = IncludeHeaders | IncludeReadOnly + IncludeRead = 1 << 1, + IncludeCreate = 1 << 2, + IncludeUpdate = 1 << 3, + IncludeAll = IncludeHeaders | IncludeRead | IncludeCreate | IncludeUpdate, + IncludeCreateOrUpdate = IncludeCreate | IncludeUpdate } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/TypeConverterExtensions.cs index 37cca7f0e136..d321674f08b7 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/internal/New-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/internal/New-AzActivityLogAlert.ps1 index 8316664a0ce5..f56145932551 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/internal/New-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/internal/New-AzActivityLogAlert.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new Activity Log Alert rule or update an existing one. +Create a new Activity Log Alert rule or create an existing one. .Description -Create a new Activity Log Alert rule or update an existing one. +Create a new Activity Log Alert rule or create an existing one. .Example $scope = "/subscriptions/"+(Get-AzContext).Subscription.ID $actiongroup=New-AzActivityLogAlertActionGroupObject -Id $ActionGroupResourceId -WebhookProperty @{"sampleWebhookProperty"="SamplePropertyValue"} @@ -29,8 +29,10 @@ $any2=New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incid $condition3=New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $any1,$any2 New-AzActivityLogAlert -Name $AlertName -ResourceGroupName $ResourceGroupName -Action $actiongroup -Condition @($condition1,$condition2,$condition3) -Location global -Scope $scope +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,78 +44,100 @@ ACTION : The list of the Action Groups. [(Any) ]: This indicates any property can be added to this object. CONDITION : The list of Activity Log Alert rule conditions. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. - [AnyOf ]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [AnyOf >]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. + +INPUTOBJECT : Identity Parameter + [ActivityLogAlertName ]: The name of the Activity Log Alert rule. + [Id ]: Resource identity path + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azactivitylogalert #> function New-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the Activity Log Alert rule. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[]] # The list of the Action Groups. - # To construct, see NOTES section for ACTION properties and create a hash table. ${Action}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[]] # The list of Activity Log Alert rule conditions. - # To construct, see NOTES section for CONDITION properties and create a hash table. ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # A description of this Activity Log Alert rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # The location of the resource. # Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String[]] @@ -122,13 +146,26 @@ param( # This list must include at least one item. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags]))] [System.Collections.Hashtable] # The tags of the resource. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -185,13 +222,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -200,6 +241,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/internal/ProxyCmdletDefinitions.ps1 index c1f0dd5cfe3b..29a48bd594c9 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new Activity Log Alert rule or update an existing one. +Create a new Activity Log Alert rule or create an existing one. .Description -Create a new Activity Log Alert rule or update an existing one. +Create a new Activity Log Alert rule or create an existing one. .Example $scope = "/subscriptions/"+(Get-AzContext).Subscription.ID $actiongroup=New-AzActivityLogAlertActionGroupObject -Id $ActionGroupResourceId -WebhookProperty @{"sampleWebhookProperty"="SamplePropertyValue"} @@ -29,8 +29,10 @@ $any2=New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incid $condition3=New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $any1,$any2 New-AzActivityLogAlert -Name $AlertName -ResourceGroupName $ResourceGroupName -Action $actiongroup -Condition @($condition1,$condition2,$condition3) -Location global -Scope $scope +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,78 +44,100 @@ ACTION : The list of the Action Groups. [(Any) ]: This indicates any property can be added to this object. CONDITION : The list of Activity Log Alert rule conditions. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. - [AnyOf ]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [AnyOf >]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. + +INPUTOBJECT : Identity Parameter + [ActivityLogAlertName ]: The name of the Activity Log Alert rule. + [Id ]: Resource identity path + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azactivitylogalert #> function New-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the Activity Log Alert rule. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[]] # The list of the Action Groups. - # To construct, see NOTES section for ACTION properties and create a hash table. ${Action}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[]] # The list of Activity Log Alert rule conditions. - # To construct, see NOTES section for CONDITION properties and create a hash table. ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # A description of this Activity Log Alert rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # The location of the resource. # Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String[]] @@ -122,13 +146,26 @@ param( # This list must include at least one item. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags]))] [System.Collections.Hashtable] # The tags of the resource. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -185,13 +222,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -200,6 +241,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -231,20 +275,20 @@ end { <# .Synopsis -Updates 'tags' and 'enabled' fields in an existing Alert rule. +Update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. -To update other fields use CreateOrUpdate operation. +To update other fields use CreateOrupdate operation. .Description -Updates 'tags' and 'enabled' fields in an existing Alert rule. +Update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. -To update other fields use CreateOrUpdate operation. +To update other fields use CreateOrupdate operation. .Example Update-AzActivityLogAlert -ResourceGroupName $ResourceGroupName -Name $AlertName -Tag @{"key"="val"} -Enabled $false .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -259,10 +303,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azactivitylogalert #> function Update-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] @@ -270,6 +316,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. @@ -277,6 +325,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -287,23 +337,36 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags]))] [System.Collections.Hashtable] # The resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -360,14 +423,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -376,6 +442,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/internal/Update-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/internal/Update-AzActivityLogAlert.ps1 index f8e6b5430e57..840742c31928 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/internal/Update-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/internal/Update-AzActivityLogAlert.ps1 @@ -16,20 +16,20 @@ <# .Synopsis -Updates 'tags' and 'enabled' fields in an existing Alert rule. +Update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. -To update other fields use CreateOrUpdate operation. +To update other fields use CreateOrupdate operation. .Description -Updates 'tags' and 'enabled' fields in an existing Alert rule. +Update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. -To update other fields use CreateOrUpdate operation. +To update other fields use CreateOrupdate operation. .Example Update-AzActivityLogAlert -ResourceGroupName $ResourceGroupName -Name $AlertName -Tag @{"key"="val"} -Enabled $false .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,10 +44,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azactivitylogalert #> function Update-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] @@ -55,6 +57,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. @@ -62,6 +66,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -72,23 +78,36 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags]))] [System.Collections.Hashtable] # The resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -145,14 +164,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -161,6 +183,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/ActivityLogAlert.Autorest/test-module.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/test-module.ps1 index 5977523d625a..745b4fb17007 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/test-module.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/test-module.ps1 @@ -12,17 +12,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +param([switch]$NotIsolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) $ErrorActionPreference = 'Stop' -if(-not $Isolated) +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' if ($PSBoundParameters.ContainsKey("TestName")) { $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," } $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -34,7 +34,7 @@ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and $ProgressPreference = 'SilentlyContinue' $baseName = $PSScriptRoot.BaseName $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) -. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule . ("$PSScriptRoot\test\utils.ps1") if ($requireResourceModule) @@ -95,4 +95,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/generated/Resources/Authorization.Autorest/Az.Authorization.format.ps1xml b/generated/Resources/Authorization.Autorest/Az.Authorization.format.ps1xml index 334d1805dabe..74803cdb597a 100644 --- a/generated/Resources/Authorization.Autorest/Az.Authorization.format.ps1xml +++ b/generated/Resources/Authorization.Autorest/Az.Authorization.format.ps1xml @@ -2,75 +2,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.AuthorizationIdentity + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.AuthorizationIdentity + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings#Multiple - - - - - - - - - - - - - - - - - - - + - + - + - + - Id - - - RoleAssignmentScheduleInstanceName - - - RoleAssignmentScheduleName - - - RoleAssignmentScheduleRequestName - - - RoleEligibilityScheduleInstanceName - - - RoleEligibilityScheduleName - - - RoleEligibilityScheduleRequestName + ApprovalMode - RoleManagementPolicyAssignmentName + IsApprovalRequired - RoleManagementPolicyName + IsApprovalRequiredForExtension - Scope + IsRequestorJustificationRequired @@ -78,39 +42,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStage - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStage#Multiple - + - + - + - + - ApprovalMode + EscalationTimeInMinute - IsApprovalRequired + IsApproverJustificationRequired - IsApprovalRequiredForExtension + IsEscalationEnabled - IsRequestorJustificationRequired + TimeOutInDay @@ -118,39 +82,75 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStage + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.AuthorizationIdentity - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStage + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.AuthorizationIdentity#Multiple - + - + - + - + + + + + + + + + + + + + + + + + + + - EscalationTimeInMinute + Id - IsApproverJustificationRequired + RoleAssignmentScheduleInstanceName - IsEscalationEnabled + RoleAssignmentScheduleName - TimeOutInDay + RoleAssignmentScheduleRequestName + + + RoleEligibilityScheduleInstanceName + + + RoleEligibilityScheduleName + + + RoleEligibilityScheduleRequestName + + + RoleManagementPolicyAssignmentName + + + RoleManagementPolicyName + + + Scope @@ -158,9 +158,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody#Multiple @@ -186,9 +186,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResource + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResource - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResource + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResource#Multiple @@ -220,9 +220,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourcesListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourcesListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourcesListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourcesListResult#Multiple @@ -242,9 +242,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal#Multiple @@ -282,9 +282,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition#Multiple @@ -316,9 +316,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope#Multiple @@ -350,9 +350,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy#Multiple @@ -378,9 +378,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition#Multiple @@ -412,9 +412,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope#Multiple @@ -446,9 +446,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope#Multiple @@ -480,9 +480,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal#Multiple @@ -520,9 +520,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule#Multiple @@ -572,9 +572,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleFilter#Multiple @@ -606,9 +606,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstance + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstance + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance#Multiple @@ -658,9 +658,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceFilter#Multiple @@ -698,9 +698,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceListResult#Multiple @@ -720,9 +720,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties#Multiple @@ -832,9 +832,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleListResult#Multiple @@ -854,9 +854,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties#Multiple @@ -960,9 +960,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest#Multiple @@ -1012,9 +1012,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestFilter#Multiple @@ -1052,9 +1052,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestListResult#Multiple @@ -1074,9 +1074,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties#Multiple @@ -1180,9 +1180,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo#Multiple @@ -1202,9 +1202,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration#Multiple @@ -1236,9 +1236,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo#Multiple @@ -1264,9 +1264,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule#Multiple @@ -1316,9 +1316,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleFilter#Multiple @@ -1350,9 +1350,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstance + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstance + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance#Multiple @@ -1402,9 +1402,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceFilter#Multiple @@ -1442,9 +1442,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceListResult#Multiple @@ -1464,9 +1464,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties#Multiple @@ -1552,9 +1552,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleListResult#Multiple @@ -1574,9 +1574,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties#Multiple @@ -1668,9 +1668,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest#Multiple @@ -1720,9 +1720,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestFilter#Multiple @@ -1760,9 +1760,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestListResult#Multiple @@ -1782,9 +1782,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties#Multiple @@ -1882,9 +1882,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo#Multiple @@ -1904,9 +1904,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration#Multiple @@ -1938,9 +1938,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo#Multiple @@ -1966,9 +1966,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy#Multiple @@ -2006,9 +2006,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyApprovalRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyApprovalRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyApprovalRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyApprovalRule#Multiple @@ -2021,21 +2021,9 @@ - - - - - - - - - - - - @@ -2049,30 +2037,18 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment#Multiple @@ -2122,9 +2098,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentListResult#Multiple @@ -2144,9 +2120,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties#Multiple @@ -2178,9 +2154,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAuthenticationContextRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAuthenticationContextRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAuthenticationContextRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAuthenticationContextRule#Multiple @@ -2193,21 +2169,9 @@ - - - - - - - - - - - - @@ -2227,21 +2191,9 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - ClaimValue @@ -2254,9 +2206,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyEnablementRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyEnablementRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyEnablementRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyEnablementRule#Multiple @@ -2269,24 +2221,9 @@ - - - - - - - - - - - - - - - @@ -2300,33 +2237,18 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - - - EnabledRule - - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyExpirationRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyExpirationRule#Multiple @@ -2339,21 +2261,9 @@ - - - - - - - - - - - - @@ -2373,21 +2283,9 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - IsExpirationRequired @@ -2400,9 +2298,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyListResult#Multiple @@ -2422,9 +2320,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyNotificationRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyNotificationRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyNotificationRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyNotificationRule#Multiple @@ -2437,30 +2335,15 @@ - - - - - - - - - - - - - - - @@ -2480,30 +2363,15 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - IsDefaultRecipientsEnabled NotificationLevel - - NotificationRecipient - NotificationType @@ -2516,9 +2384,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties#Multiple @@ -2562,9 +2430,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule#Multiple @@ -2590,30 +2458,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget#Multiple - - - - - - - - - - - - @@ -2621,30 +2477,18 @@ Caller - - EnforcedSetting - - - InheritableSetting - Level - - Operation - - - TargetObject - - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSet + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSet - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSet + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSet#Multiple diff --git a/generated/Resources/Authorization.Autorest/Az.Authorization.psd1 b/generated/Resources/Authorization.Autorest/Az.Authorization.psd1 index 6a0e0212da5d..e5b022b5b7cf 100644 --- a/generated/Resources/Authorization.Autorest/Az.Authorization.psd1 +++ b/generated/Resources/Authorization.Autorest/Az.Authorization.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.Authorization.private.dll' FormatsToProcess = './Az.Authorization.format.ps1xml' - FunctionsToExport = 'Get-AzRoleAssignmentSchedule', 'Get-AzRoleAssignmentScheduleInstance', 'Get-AzRoleAssignmentScheduleRequest', 'Get-AzRoleEligibilitySchedule', 'Get-AzRoleEligibilityScheduleInstance', 'Get-AzRoleEligibilityScheduleRequest', 'Get-AzRoleEligibleChildResource', 'Get-AzRoleManagementPolicy', 'Get-AzRoleManagementPolicyAssignment', 'New-AzRoleAssignmentScheduleRequest', 'New-AzRoleEligibilityScheduleRequest', 'New-AzRoleManagementPolicyAssignment', 'Remove-AzRoleManagementPolicy', 'Remove-AzRoleManagementPolicyAssignment', 'Stop-AzRoleAssignmentScheduleRequest', 'Stop-AzRoleEligibilityScheduleRequest', 'Update-AzRoleManagementPolicy', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzRoleAssignmentSchedule', 'Get-AzRoleAssignmentScheduleInstance', 'Get-AzRoleAssignmentScheduleRequest', 'Get-AzRoleEligibilitySchedule', 'Get-AzRoleEligibilityScheduleInstance', 'Get-AzRoleEligibilityScheduleRequest', 'Get-AzRoleEligibleChildResource', 'Get-AzRoleManagementPolicy', 'Get-AzRoleManagementPolicyAssignment', 'New-AzRoleAssignmentScheduleRequest', 'New-AzRoleEligibilityScheduleRequest', 'New-AzRoleManagementPolicyAssignment', 'Remove-AzRoleManagementPolicy', 'Remove-AzRoleManagementPolicyAssignment', 'Stop-AzRoleAssignmentScheduleRequest', 'Stop-AzRoleEligibilityScheduleRequest', 'Update-AzRoleAssignmentScheduleRequest', 'Update-AzRoleEligibilityScheduleRequest', 'Update-AzRoleManagementPolicy', 'Update-AzRoleManagementPolicyAssignment' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Authorization' diff --git a/generated/Resources/Authorization.Autorest/Properties/AssemblyInfo.cs b/generated/Resources/Authorization.Autorest/Properties/AssemblyInfo.cs index f15d49147166..81c0c1fe4e12 100644 --- a/generated/Resources/Authorization.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Resources/Authorization.Autorest/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Authorization")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("8.0.1")] -[assembly: System.Reflection.AssemblyVersionAttribute("8.0.1")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("8.1.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("8.1.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/Resources/Authorization.Autorest/check-dependencies.ps1 b/generated/Resources/Authorization.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Resources/Authorization.Autorest/check-dependencies.ps1 +++ b/generated/Resources/Authorization.Autorest/check-dependencies.ps1 @@ -12,13 +12,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) $ErrorActionPreference = 'Stop' -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 index 2fe3f1345674..54503191d71a 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 @@ -36,7 +36,7 @@ Get-AzRoleAssignmentSchedule -Scope $scope -Name "4cd7e26b-8eca-425c-969d-ec708c .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedule #> function Get-AzRoleAssignmentSchedule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 index 14993662673e..5eaf6770c72e 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 @@ -36,7 +36,7 @@ Get-AzRoleAssignmentScheduleInstance -Scope $scope -Name "4cd7e26b-8eca-425c-969 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentscheduleinstance #> function Get-AzRoleAssignmentScheduleInstance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 index 175e0ae89b6f..d0ae761319da 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 @@ -35,7 +35,7 @@ Get-AzRoleAssignmentScheduleRequest -Scope $scope -Name "2cc018c2-27f8-4730-a0bc .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -56,7 +56,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedulerequest #> function Get-AzRoleAssignmentScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -77,7 +77,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 index 4391f3e0cd9d..32e016031467 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 @@ -36,7 +36,7 @@ Get-AzRoleEligibilitySchedule -Scope $scope -Name "4cd7e26b-8eca-425c-969d-ec708 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedule #> function Get-AzRoleEligibilitySchedule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 index ff6e6ef71529..383fd163cefe 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 @@ -36,7 +36,7 @@ Get-AzRoleEligibilityScheduleInstance -Scope $scope -Name "4cd7e26b-8eca-425c-96 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityscheduleinstance #> function Get-AzRoleEligibilityScheduleInstance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 index 1e7f581bdaa7..2b5b8dbcf614 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 @@ -35,7 +35,7 @@ Get-AzRoleEligibilityScheduleRequest -Scope $scope -Name "2cc018c2-27f8-4730-a0b .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -56,7 +56,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedulerequest #> function Get-AzRoleEligibilityScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -77,7 +77,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 index e3031b7d831c..a0e60106503e 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 @@ -24,49 +24,24 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" Get-AzRoleEligibleChildResource -Scope $scope .Example $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$filter = "resoureType eq 'resourcegroup'" +$filter = "resourceType eq 'resourcegroup'" Get-AzRoleEligibleChildResource -Scope $scope -Filter $filter -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -INPUTOBJECT : Identity Parameter - [Id ]: Resource identity path - [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. - [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. - [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. - [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. - [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. - [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. - [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. - [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. - [Scope ]: The scope of the role management policy. +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource .Link https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligiblechildresource #> function Get-AzRoleEligibleChildResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( - [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] # The scope of the role management policy. ${Scope}, - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Query')] [System.String] @@ -131,6 +106,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -151,7 +135,6 @@ begin { $mapping = @{ Get = 'Az.Authorization.private\Get-AzRoleEligibleChildResource_Get'; - GetViaIdentity = 'Az.Authorization.private\Get-AzRoleEligibleChildResource_GetViaIdentity'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -160,6 +143,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 index e77bd6af2fef..c65c1d27ad4a 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 @@ -30,7 +30,7 @@ Get-AzRoleManagementPolicy -Scope $scope -Name $name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy .Notes COMPLEX PARAMETER PROPERTIES @@ -51,7 +51,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicy #> function Get-AzRoleManagementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -72,7 +72,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -131,6 +130,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -161,6 +169,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 index 9a93332d5a09..91d4db362dc4 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 @@ -30,7 +30,7 @@ Get-AzRoleManagementPolicyAssignment -Scope $scope -Name $name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment .Notes COMPLEX PARAMETER PROPERTIES @@ -51,7 +51,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicyassignment #> function Get-AzRoleManagementPolicyAssignment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -72,7 +72,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -131,6 +130,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -161,6 +169,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 index 16ba2a9504ac..853d3268c07a 100644 --- a/generated/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Creates a role assignment schedule request. +Create a role assignment schedule request. .Description -Creates a role assignment schedule request. +Create a role assignment schedule request. .Example $guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" $startTime = Get-Date -Format o @@ -41,12 +41,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleAssignmentScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType SelfDeactivate -RoleDefinitionId subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Link https://learn.microsoft.com/powershell/module/az.resources/new-azroleassignmentschedulerequest #> function New-AzRoleAssignmentScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -65,7 +65,7 @@ param( # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The conditions on the role assignment. @@ -73,94 +73,106 @@ param( # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Version of the condition. # Currently accepted value is '2.0' ${ConditionVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Duration of the role assignment schedule in TimeSpan. ${ExpirationDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # End DateTime of the role assignment schedule. ${ExpirationEndDateTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type] + [System.String] # Type of the role assignment schedule expiration ${ExpirationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Justification for the role assignment ${Justification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The linked role eligibility schedule id - to activate an eligibility. ${LinkedRoleEligibilityScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The principal ID. ${PrincipalId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType] + [System.String] # The type of the role assignment schedule request. # Eg: SelfActivate, AdminAssign etc ${RequestType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition ID. ${RoleDefinitionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # Start DateTime of the role assignment schedule. ${ScheduleInfoStartDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The resultant role assignment schedule id or the role assignment schedule id being updated ${TargetRoleAssignmentScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role assignment schedule instance id being updated ${TargetRoleAssignmentScheduleInstanceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket number for the role assignment ${TicketNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket system name for the role assignment ${TicketSystem}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -217,6 +229,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -237,6 +258,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -245,6 +268,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 index cf1964520554..76a75a236437 100644 --- a/generated/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Creates a role eligibility schedule request. +Create a role eligibility schedule request. .Description -Creates a role eligibility schedule request. +Create a role eligibility schedule request. .Example $guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" $startTime = Get-Date -Format o @@ -31,12 +31,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminRemove -RoleDefinitionId subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest .Link https://learn.microsoft.com/powershell/module/az.resources/new-azroleeligibilityschedulerequest #> function New-AzRoleEligibilityScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -55,7 +55,7 @@ param( # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The conditions on the role assignment. @@ -63,88 +63,100 @@ param( # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Version of the condition. # Currently accepted value is '2.0' ${ConditionVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Duration of the role eligibility schedule in TimeSpan. ${ExpirationDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # End DateTime of the role eligibility schedule. ${ExpirationEndDateTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type] + [System.String] # Type of the role eligibility schedule expiration ${ExpirationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Justification for the role eligibility ${Justification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The principal ID. ${PrincipalId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType] + [System.String] # The type of the role assignment schedule request. # Eg: SelfActivate, AdminAssign etc ${RequestType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition ID. ${RoleDefinitionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # Start DateTime of the role eligibility schedule. ${ScheduleInfoStartDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The resultant role eligibility schedule id or the role eligibility schedule id being updated ${TargetRoleEligibilityScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role eligibility schedule instance id being updated ${TargetRoleEligibilityScheduleInstanceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket number for the role eligibility ${TicketNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket system name for the role eligibility ${TicketSystem}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -201,6 +213,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -221,6 +242,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -229,6 +252,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 b/generated/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 index 4ec02b194e7f..18c698e236d1 100644 --- a/generated/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 @@ -24,12 +24,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleManagementPolicyAssignment -Scope $scope -Name "0a4d3ef7-147b-4777-a958-ae9dfab3c331" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment .Link https://learn.microsoft.com/powershell/module/az.resources/new-azrolemanagementpolicyassignment #> function New-AzRoleManagementPolicyAssignment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -45,18 +45,30 @@ param( # The scope of the role management policy assignment to upsert. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The policy id role management policy assignment. ${PolicyId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition of management policy assignment. ${RoleDefinitionId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -113,6 +125,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -133,6 +154,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -141,6 +164,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 index ffe051446715..95f3df1196e8 100644 --- a/generated/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -36,7 +36,7 @@ Get-AzRoleAssignmentScheduleInstance -Scope $scope -Name "4cd7e26b-8eca-425c-969 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentscheduleinstance #> function Get-AzRoleAssignmentScheduleInstance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -241,7 +252,7 @@ Get-AzRoleAssignmentScheduleRequest -Scope $scope -Name "2cc018c2-27f8-4730-a0bc .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -262,7 +273,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedulerequest #> function Get-AzRoleAssignmentScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -283,7 +294,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -353,6 +363,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -383,6 +402,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -448,7 +470,7 @@ Get-AzRoleAssignmentSchedule -Scope $scope -Name "4cd7e26b-8eca-425c-969d-ec708c .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule .Notes COMPLEX PARAMETER PROPERTIES @@ -469,7 +491,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedule #> function Get-AzRoleAssignmentSchedule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -490,7 +512,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -559,6 +580,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -589,6 +619,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -654,7 +687,7 @@ Get-AzRoleEligibilityScheduleInstance -Scope $scope -Name "4cd7e26b-8eca-425c-96 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -675,7 +708,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityscheduleinstance #> function Get-AzRoleEligibilityScheduleInstance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -696,7 +729,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -765,6 +797,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -795,6 +836,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -859,7 +903,7 @@ Get-AzRoleEligibilityScheduleRequest -Scope $scope -Name "2cc018c2-27f8-4730-a0b .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -880,7 +924,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedulerequest #> function Get-AzRoleEligibilityScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -901,7 +945,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -971,6 +1014,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1001,6 +1053,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1066,7 +1121,7 @@ Get-AzRoleEligibilitySchedule -Scope $scope -Name "4cd7e26b-8eca-425c-969d-ec708 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule .Notes COMPLEX PARAMETER PROPERTIES @@ -1087,7 +1142,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedule #> function Get-AzRoleEligibilitySchedule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1108,7 +1163,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -1177,6 +1231,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1207,6 +1270,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1260,49 +1326,24 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" Get-AzRoleEligibleChildResource -Scope $scope .Example $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$filter = "resoureType eq 'resourcegroup'" +$filter = "resourceType eq 'resourcegroup'" Get-AzRoleEligibleChildResource -Scope $scope -Filter $filter -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -INPUTOBJECT : Identity Parameter - [Id ]: Resource identity path - [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. - [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. - [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. - [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. - [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. - [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. - [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. - [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. - [Scope ]: The scope of the role management policy. +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource .Link https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligiblechildresource #> function Get-AzRoleEligibleChildResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( - [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] # The scope of the role management policy. ${Scope}, - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Query')] [System.String] @@ -1367,6 +1408,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1387,7 +1437,6 @@ begin { $mapping = @{ Get = 'Az.Authorization.private\Get-AzRoleEligibleChildResource_Get'; - GetViaIdentity = 'Az.Authorization.private\Get-AzRoleEligibleChildResource_GetViaIdentity'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1396,6 +1445,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1455,7 +1507,7 @@ Get-AzRoleManagementPolicyAssignment -Scope $scope -Name $name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment .Notes COMPLEX PARAMETER PROPERTIES @@ -1476,7 +1528,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicyassignment #> function Get-AzRoleManagementPolicyAssignment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1497,7 +1549,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1556,6 +1607,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1586,6 +1646,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1645,7 +1708,7 @@ Get-AzRoleManagementPolicy -Scope $scope -Name $name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy .Notes COMPLEX PARAMETER PROPERTIES @@ -1666,7 +1729,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicy #> function Get-AzRoleManagementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1687,7 +1750,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1746,6 +1808,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1776,6 +1847,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1821,9 +1895,9 @@ end { <# .Synopsis -Creates a role assignment schedule request. +Create a role assignment schedule request. .Description -Creates a role assignment schedule request. +Create a role assignment schedule request. .Example $guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" $startTime = Get-Date -Format o @@ -1846,12 +1920,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleAssignmentScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType SelfDeactivate -RoleDefinitionId subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Link https://learn.microsoft.com/powershell/module/az.resources/new-azroleassignmentschedulerequest #> function New-AzRoleAssignmentScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -1870,7 +1944,7 @@ param( # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The conditions on the role assignment. @@ -1878,94 +1952,106 @@ param( # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Version of the condition. # Currently accepted value is '2.0' ${ConditionVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Duration of the role assignment schedule in TimeSpan. ${ExpirationDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # End DateTime of the role assignment schedule. ${ExpirationEndDateTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type] + [System.String] # Type of the role assignment schedule expiration ${ExpirationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Justification for the role assignment ${Justification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The linked role eligibility schedule id - to activate an eligibility. ${LinkedRoleEligibilityScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The principal ID. ${PrincipalId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType] + [System.String] # The type of the role assignment schedule request. # Eg: SelfActivate, AdminAssign etc ${RequestType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition ID. ${RoleDefinitionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # Start DateTime of the role assignment schedule. ${ScheduleInfoStartDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The resultant role assignment schedule id or the role assignment schedule id being updated ${TargetRoleAssignmentScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role assignment schedule instance id being updated ${TargetRoleAssignmentScheduleInstanceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket number for the role assignment ${TicketNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket system name for the role assignment ${TicketSystem}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2022,6 +2108,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2042,6 +2137,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2050,6 +2147,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2095,9 +2195,9 @@ end { <# .Synopsis -Creates a role eligibility schedule request. +Create a role eligibility schedule request. .Description -Creates a role eligibility schedule request. +Create a role eligibility schedule request. .Example $guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" $startTime = Get-Date -Format o @@ -2110,12 +2210,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminRemove -RoleDefinitionId subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest .Link https://learn.microsoft.com/powershell/module/az.resources/new-azroleeligibilityschedulerequest #> function New-AzRoleEligibilityScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -2134,7 +2234,7 @@ param( # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The conditions on the role assignment. @@ -2142,88 +2242,100 @@ param( # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Version of the condition. # Currently accepted value is '2.0' ${ConditionVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Duration of the role eligibility schedule in TimeSpan. ${ExpirationDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # End DateTime of the role eligibility schedule. ${ExpirationEndDateTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type] + [System.String] # Type of the role eligibility schedule expiration ${ExpirationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Justification for the role eligibility ${Justification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The principal ID. ${PrincipalId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType] + [System.String] # The type of the role assignment schedule request. # Eg: SelfActivate, AdminAssign etc ${RequestType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition ID. ${RoleDefinitionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # Start DateTime of the role eligibility schedule. ${ScheduleInfoStartDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The resultant role eligibility schedule id or the role eligibility schedule id being updated ${TargetRoleEligibilityScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role eligibility schedule instance id being updated ${TargetRoleEligibilityScheduleInstanceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket number for the role eligibility ${TicketNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket system name for the role eligibility ${TicketSystem}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2280,6 +2392,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2300,6 +2421,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2308,6 +2431,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2361,12 +2487,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleManagementPolicyAssignment -Scope $scope -Name "0a4d3ef7-147b-4777-a958-ae9dfab3c331" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment .Link https://learn.microsoft.com/powershell/module/az.resources/new-azrolemanagementpolicyassignment #> function New-AzRoleManagementPolicyAssignment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -2382,18 +2508,30 @@ param( # The scope of the role management policy assignment to upsert. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The policy id role management policy assignment. ${PolicyId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition of management policy assignment. ${RoleDefinitionId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2450,6 +2588,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2470,6 +2617,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2478,6 +2627,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2574,7 +2726,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -2639,6 +2790,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2668,6 +2828,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2764,7 +2927,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -2829,6 +2991,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2858,6 +3029,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2955,7 +3129,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -3020,6 +3193,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3049,6 +3231,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3146,7 +3331,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -3211,6 +3395,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3240,6 +3433,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3285,61 +3481,19 @@ end { <# .Synopsis -Update a role management policy +Update a role assignment schedule request. .Description -Update a role management policy -.Example -$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$expirationRule = [RoleManagementPolicyExpirationRule]@{ - isExpirationRequired = "false"; - maximumDuration = "P180D"; - id = "Expiration_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); - targetCaller = "Admin"; - targetOperation = @('All'); - targetLevel = "Eligibility"; - targetObject = $null; - targetInheritableSetting = $null; - targetEnforcedSetting = $null; - } -$rules = [IRoleManagementPolicyRule[]]@($expirationRule) -Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules +Update a role assignment schedule request. .Example -$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$expirationRule = [RoleManagementPolicyExpirationRule]@{ - isExpirationRequired = "false"; - maximumDuration = "P180D"; - id = "Expiration_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); - targetCaller = "Admin"; - targetOperation = @('All'); - targetLevel = "Eligibility"; - targetObject = $null; - targetInheritableSetting = $null; - targetEnforcedSetting = $null; - } -$notificationRule = [RoleManagementPolicyNotificationRule]@{ - notificationType = "Email"; - recipientType = "Approver"; - isDefaultRecipientsEnabled = "false"; - notificationLevel = "Critical"; - notificationRecipient = $null; - id = "Notification_Approver_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyNotificationRule"); - targetCaller = "Admin"; - targetOperation = @('All'); - targetLevel = "Eligibility"; - targetObject = $null; - targetInheritableSetting = $null; - targetEnforcedSetting = $null; - } -$rules = [IRoleManagementPolicyRule[]]@($expirationRule, $notificationRule) -Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules +$guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" +$startTime = Get-Date -Format o +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleAssignmentScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminAssign -RoleDefinitionId subscriptions/11111111-2222-3333-4444-123456789101/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -3356,112 +3510,965 @@ INPUTOBJECT : Identity Parameter [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. [Scope ]: The scope of the role management policy. - -RULE : The rule applied to the policy. - RuleType : The type of rule - [Id ]: The id of the rule. - [TargetCaller ]: The caller of the setting. - [TargetEnforcedSetting ]: The list of enforced settings. - [TargetInheritableSetting ]: The list of inheritable settings. - [TargetLevel ]: The assignment level to which it is applied. - [TargetObject ]: The list of target objects. - [TargetOperation ]: The type of operation. .Link -https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicy +https://learn.microsoft.com/powershell/module/az.resources/update-azroleassignmentschedulerequest #> -function Update-AzRoleManagementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy])] +function Update-AzRoleAssignmentScheduleRequest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Alias('RoleManagementPolicyName')] + [Alias('RoleAssignmentScheduleRequestName')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] - # The name (guid) of the role management policy to upsert. + # The name of the role assignment to create. + # It can be any valid GUID. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] - # The scope of the role management policy to upsert. + # The scope of the role assignment schedule request to create. + # The scope can be any REST resource instance. + # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] - # The role management policy description. - ${Description}, + # The conditions on the role assignment. + # This limits the resources it can be assigned to. + # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' + ${Condition}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] - # The role management policy display name. - ${DisplayName}, + # Version of the condition. + # Currently accepted value is '2.0' + ${ConditionVersion}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [System.Management.Automation.SwitchParameter] - # The role management policy is default policy. - ${IsOrganizationDefault}, + [System.String] + # Duration of the role assignment schedule in TimeSpan. + ${ExpirationDuration}, [Parameter()] - [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]] - # The rule applied to the policy. - # To construct, see NOTES section for RULE properties and create a hash table. - ${Rule}, + [System.DateTime] + # End DateTime of the role assignment schedule. + ${ExpirationEndDateTime}, [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Type of the role assignment schedule expiration + ${ExpirationType}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Justification for the role assignment + ${Justification}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The linked role eligibility schedule id - to activate an eligibility. + ${LinkedRoleEligibilityScheduleId}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The principal ID. + ${PrincipalId}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The type of the role assignment schedule request. + # Eg: SelfActivate, AdminAssign etc + ${RequestType}, - [Parameter(DontShow)] + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition ID. + ${RoleDefinitionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # Start DateTime of the role assignment schedule. + ${ScheduleInfoStartDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The resultant role assignment schedule id or the role assignment schedule id being updated + ${TargetRoleAssignmentScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role assignment schedule instance id being updated + ${TargetRoleAssignmentScheduleInstanceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket number for the role assignment + ${TicketNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket system name for the role assignment + ${TicketSystem}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Authorization.private\Update-AzRoleAssignmentScheduleRequest_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $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.Resources.Authorization.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 a role eligibility schedule request. +.Description +Update a role eligibility schedule request. +.Example +$guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" +$startTime = Get-Date -Format o +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminAssign -RoleDefinitionId subscriptions/11111111-2222-3333-4444-123456789101/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azroleeligibilityschedulerequest +#> +function Update-AzRoleEligibilityScheduleRequest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleEligibilityScheduleRequestName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of the role eligibility to create. + # It can be any valid GUID. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role eligibility schedule request to create. + # The scope can be any REST resource instance. + # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The conditions on the role assignment. + # This limits the resources it can be assigned to. + # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' + ${Condition}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Version of the condition. + # Currently accepted value is '2.0' + ${ConditionVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Duration of the role eligibility schedule in TimeSpan. + ${ExpirationDuration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # End DateTime of the role eligibility schedule. + ${ExpirationEndDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Type of the role eligibility schedule expiration + ${ExpirationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Justification for the role eligibility + ${Justification}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The principal ID. + ${PrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The type of the role assignment schedule request. + # Eg: SelfActivate, AdminAssign etc + ${RequestType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition ID. + ${RoleDefinitionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # Start DateTime of the role eligibility schedule. + ${ScheduleInfoStartDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The resultant role eligibility schedule id or the role eligibility schedule id being updated + ${TargetRoleEligibilityScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role eligibility schedule instance id being updated + ${TargetRoleEligibilityScheduleInstanceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket number for the role eligibility + ${TicketNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket system name for the role eligibility + ${TicketSystem}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Authorization.private\Update-AzRoleEligibilityScheduleRequest_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $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.Resources.Authorization.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 a role management policy assignment +.Description +Update a role management policy assignment +.Example +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleManagementPolicyAssignment -Scope $scope -Name "11111111-2222-3333-4444-123456789102" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicyassignment +#> +function Update-AzRoleManagementPolicyAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleManagementPolicyAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of format {guid_guid} the role management policy assignment to upsert. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role management policy assignment to upsert. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The policy id role management policy assignment. + ${PolicyId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition of management policy assignment. + ${RoleDefinitionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Authorization.private\Update-AzRoleManagementPolicyAssignment_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $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.Resources.Authorization.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 a role management policy +.Description +Update a role management policy +.Example +$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" +$expirationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule]@{ + isExpirationRequired = "false"; + maximumDuration = "P180D"; + id = "Expiration_Admin_Eligibility"; + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); + targetCaller = "Admin"; + targetOperation = @('All'); + targetLevel = "Eligibility"; + targetObject = $null; + targetInheritableSetting = $null; + targetEnforcedSetting = $null; + } +$rules = [IRoleManagementPolicyRule[]]@($expirationRule) +Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules +.Example +$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" +$expirationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule]@{ + isExpirationRequired = "false"; + maximumDuration = "P180D"; + id = "Expiration_Admin_Eligibility"; + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); + targetCaller = "Admin"; + targetOperation = @('All'); + targetLevel = "Eligibility"; + targetObject = $null; + targetInheritableSetting = $null; + targetEnforcedSetting = $null; + } +$notificationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyNotificationRule]@{ + notificationType = "Email"; + recipientType = "Approver"; + isDefaultRecipientsEnabled = "false"; + notificationLevel = "Critical"; + notificationRecipient = $null; + id = "Notification_Approver_Admin_Eligibility"; + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyNotificationRule"); + targetCaller = "Admin"; + targetOperation = @('All'); + targetLevel = "Eligibility"; + targetObject = $null; + targetInheritableSetting = $null; + targetEnforcedSetting = $null; + } +$rules = [IRoleManagementPolicyRule[]]@($expirationRule, $notificationRule) +Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. + +RULE : The rule applied to the policy. + RuleType : The type of rule + [Id ]: The id of the rule. + [TargetCaller ]: The caller of the setting. + [TargetEnforcedSetting >]: The list of enforced settings. + [TargetInheritableSetting >]: The list of inheritable settings. + [TargetLevel ]: The assignment level to which it is applied. + [TargetObject >]: The list of target objects. + [TargetOperation >]: The type of operation. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicy +#> +function Update-AzRoleManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Alias('RoleManagementPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name (guid) of the role management policy to upsert. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role management policy to upsert. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role management policy description. + ${Description}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role management policy display name. + ${DisplayName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The role management policy is default policy. + ${IsOrganizationDefault}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule[]] + # The rule applied to the policy. + ${Rule}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy @@ -3475,6 +4482,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3496,6 +4512,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -3504,6 +4522,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 b/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 index 6fc7995199d3..1cadc85c0d90 100644 --- a/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -132,6 +131,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -161,6 +169,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 b/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 index d45eaa7b1505..20eef454f6e0 100644 --- a/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -132,6 +131,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -161,6 +169,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 index d9f880ae00ce..93a9c7a74a41 100644 --- a/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 @@ -68,7 +68,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -133,6 +132,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -162,6 +170,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 index 4c044ab56360..770efc11e570 100644 --- a/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 @@ -68,7 +68,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -133,6 +132,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -162,6 +170,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Update-AzRoleAssignmentScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleAssignmentScheduleRequest.ps1 new file mode 100644 index 000000000000..df05525737e8 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleAssignmentScheduleRequest.ps1 @@ -0,0 +1,311 @@ + +# ---------------------------------------------------------------------------------- +# 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 a role assignment schedule request. +.Description +Update a role assignment schedule request. +.Example +$guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" +$startTime = Get-Date -Format o +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleAssignmentScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminAssign -RoleDefinitionId subscriptions/11111111-2222-3333-4444-123456789101/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azroleassignmentschedulerequest +#> +function Update-AzRoleAssignmentScheduleRequest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleAssignmentScheduleRequestName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of the role assignment to create. + # It can be any valid GUID. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role assignment schedule request to create. + # The scope can be any REST resource instance. + # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The conditions on the role assignment. + # This limits the resources it can be assigned to. + # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' + ${Condition}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Version of the condition. + # Currently accepted value is '2.0' + ${ConditionVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Duration of the role assignment schedule in TimeSpan. + ${ExpirationDuration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # End DateTime of the role assignment schedule. + ${ExpirationEndDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Type of the role assignment schedule expiration + ${ExpirationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Justification for the role assignment + ${Justification}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The linked role eligibility schedule id - to activate an eligibility. + ${LinkedRoleEligibilityScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The principal ID. + ${PrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The type of the role assignment schedule request. + # Eg: SelfActivate, AdminAssign etc + ${RequestType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition ID. + ${RoleDefinitionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # Start DateTime of the role assignment schedule. + ${ScheduleInfoStartDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The resultant role assignment schedule id or the role assignment schedule id being updated + ${TargetRoleAssignmentScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role assignment schedule instance id being updated + ${TargetRoleAssignmentScheduleInstanceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket number for the role assignment + ${TicketNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket system name for the role assignment + ${TicketSystem}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Authorization.private\Update-AzRoleAssignmentScheduleRequest_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $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.Resources.Authorization.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/generated/Resources/Authorization.Autorest/exports/Update-AzRoleEligibilityScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleEligibilityScheduleRequest.ps1 new file mode 100644 index 000000000000..d05651f74e2f --- /dev/null +++ b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleEligibilityScheduleRequest.ps1 @@ -0,0 +1,305 @@ + +# ---------------------------------------------------------------------------------- +# 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 a role eligibility schedule request. +.Description +Update a role eligibility schedule request. +.Example +$guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" +$startTime = Get-Date -Format o +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminAssign -RoleDefinitionId subscriptions/11111111-2222-3333-4444-123456789101/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azroleeligibilityschedulerequest +#> +function Update-AzRoleEligibilityScheduleRequest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleEligibilityScheduleRequestName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of the role eligibility to create. + # It can be any valid GUID. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role eligibility schedule request to create. + # The scope can be any REST resource instance. + # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The conditions on the role assignment. + # This limits the resources it can be assigned to. + # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' + ${Condition}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Version of the condition. + # Currently accepted value is '2.0' + ${ConditionVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Duration of the role eligibility schedule in TimeSpan. + ${ExpirationDuration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # End DateTime of the role eligibility schedule. + ${ExpirationEndDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Type of the role eligibility schedule expiration + ${ExpirationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Justification for the role eligibility + ${Justification}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The principal ID. + ${PrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The type of the role assignment schedule request. + # Eg: SelfActivate, AdminAssign etc + ${RequestType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition ID. + ${RoleDefinitionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # Start DateTime of the role eligibility schedule. + ${ScheduleInfoStartDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The resultant role eligibility schedule id or the role eligibility schedule id being updated + ${TargetRoleEligibilityScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role eligibility schedule instance id being updated + ${TargetRoleEligibilityScheduleInstanceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket number for the role eligibility + ${TicketNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket system name for the role eligibility + ${TicketSystem}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Authorization.private\Update-AzRoleEligibilityScheduleRequest_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $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.Resources.Authorization.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/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 index b601d45a19d6..069627bd80bd 100644 --- a/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 @@ -21,11 +21,11 @@ Update a role management policy Update a role management policy .Example $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$expirationRule = [RoleManagementPolicyExpirationRule]@{ +$expirationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule]@{ isExpirationRequired = "false"; maximumDuration = "P180D"; id = "Expiration_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); targetCaller = "Admin"; targetOperation = @('All'); targetLevel = "Eligibility"; @@ -37,11 +37,11 @@ $rules = [IRoleManagementPolicyRule[]]@($expirationRule) Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules .Example $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$expirationRule = [RoleManagementPolicyExpirationRule]@{ +$expirationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule]@{ isExpirationRequired = "false"; maximumDuration = "P180D"; id = "Expiration_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); targetCaller = "Admin"; targetOperation = @('All'); targetLevel = "Eligibility"; @@ -49,14 +49,14 @@ $expirationRule = [RoleManagementPolicyExpirationRule]@{ targetInheritableSetting = $null; targetEnforcedSetting = $null; } -$notificationRule = [RoleManagementPolicyNotificationRule]@{ +$notificationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyNotificationRule]@{ notificationType = "Email"; recipientType = "Approver"; isDefaultRecipientsEnabled = "false"; notificationLevel = "Critical"; notificationRecipient = $null; id = "Notification_Approver_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyNotificationRule"); + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyNotificationRule"); targetCaller = "Admin"; targetOperation = @('All'); targetLevel = "Eligibility"; @@ -70,7 +70,7 @@ Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588d .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy .Notes COMPLEX PARAMETER PROPERTIES @@ -89,22 +89,24 @@ INPUTOBJECT : Identity Parameter [Scope ]: The scope of the role management policy. RULE : The rule applied to the policy. - RuleType : The type of rule + RuleType : The type of rule [Id ]: The id of the rule. [TargetCaller ]: The caller of the setting. - [TargetEnforcedSetting ]: The list of enforced settings. - [TargetInheritableSetting ]: The list of inheritable settings. + [TargetEnforcedSetting >]: The list of enforced settings. + [TargetInheritableSetting >]: The list of inheritable settings. [TargetLevel ]: The assignment level to which it is applied. - [TargetObject ]: The list of target objects. - [TargetOperation ]: The type of operation. + [TargetObject >]: The list of target objects. + [TargetOperation >]: The type of operation. .Link https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicy #> function Update-AzRoleManagementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('RoleManagementPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] @@ -112,6 +114,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] # The scope of the role management policy to upsert. @@ -121,35 +125,49 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role management policy description. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role management policy display name. ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.Management.Automation.SwitchParameter] # The role management policy is default policy. ${IsOrganizationDefault}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule[]] # The rule applied to the policy. - # To construct, see NOTES section for RULE properties and create a hash table. ${Rule}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -206,6 +224,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -227,6 +254,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -235,6 +264,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicyAssignment.ps1 b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicyAssignment.ps1 new file mode 100644 index 000000000000..5b6153f85e5b --- /dev/null +++ b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicyAssignment.ps1 @@ -0,0 +1,222 @@ + +# ---------------------------------------------------------------------------------- +# 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 a role management policy assignment +.Description +Update a role management policy assignment +.Example +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleManagementPolicyAssignment -Scope $scope -Name "11111111-2222-3333-4444-123456789102" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicyassignment +#> +function Update-AzRoleManagementPolicyAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleManagementPolicyAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of format {guid_guid} the role management policy assignment to upsert. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role management policy assignment to upsert. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The policy id role management policy assignment. + ${PolicyId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition of management policy assignment. + ${RoleDefinitionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Authorization.private\Update-AzRoleManagementPolicyAssignment_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $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.Resources.Authorization.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/generated/Resources/Authorization.Autorest/generate-info.json b/generated/Resources/Authorization.Autorest/generate-info.json index 22aa1aaeab27..7c323249ce95 100644 --- a/generated/Resources/Authorization.Autorest/generate-info.json +++ b/generated/Resources/Authorization.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "8fe8fe69-a25b-4e80-bc00-40fc0d30dab6" + "generate_Id": "8857adb4-91da-4a2d-95e8-717ed4177318" } diff --git a/generated/Resources/Authorization.Autorest/generated/Module.cs b/generated/Resources/Authorization.Autorest/generated/Module.cs index d32f2a1d3337..203a08751993 100644 --- a/generated/Resources/Authorization.Autorest/generated/Module.cs +++ b/generated/Resources/Authorization.Autorest/generated/Module.cs @@ -28,12 +28,20 @@ public partial class Module public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + private static bool _init = false; + + private static readonly global::System.Object _initLock = new global::System.Object(); + + private static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,14 +64,11 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } } /// The Name of this module - public string Name => @"Az.Authorization"; + public string Name => @"Az.Resources"; /// The delegate to call when this module is loaded (supporting a commmon module). public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } @@ -75,7 +80,7 @@ public partial class Module public global::System.String ProfileName { get; set; } /// The ResourceID for this module (azure arm). - public string ResourceId => @"Az.Authorization"; + public string ResourceId => @"Az.Resources"; /// The delegate to call in WriteObject to sanitize the output object. public SanitizerDelegate SanitizeOutput { get; set; } @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPi /// Initialization steps performed after the module is loaded. public void Init() { - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); - CustomInit(); + if (_init == false) + { + lock (_initLock) { + if (_init == false) { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + _init = true; + } + } + } } /// Creates the module instance. diff --git a/generated/Resources/Authorization.Autorest/generated/api/Authorization.cs b/generated/Resources/Authorization.Autorest/generated/api/Authorization.cs index dab79479d127..da378eefa3d1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Authorization.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Authorization.cs @@ -29,7 +29,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task EligibleChildResourcesGet(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task EligibleChildResourcesGet(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -55,7 +55,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.EligibleChildResourcesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.EligibleChildResourcesGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -72,7 +72,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task EligibleChildResourcesGetViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task EligibleChildResourcesGetViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -108,11 +108,165 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.EligibleChildResourcesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.EligibleChildResourcesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Get the child resources of a resource on which user has eligible access + /// + /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + /// resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter + /// on resource of type = 'Subscription' or 'ResourceGroup' + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EligibleChildResourcesGetViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/eligibleChildResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/eligibleChildResources'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/eligibleChildResources" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.EligibleChildResourcesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the child resources of a resource on which user has eligible access + /// The scope of the role management policy. + /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + /// resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter + /// on resource of type = 'Subscription' or 'ResourceGroup' + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EligibleChildResourcesGetWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/eligibleChildResources" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.EligibleChildResourcesGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EligibleChildResourcesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourcesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -122,7 +276,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task EligibleChildResourcesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task EligibleChildResourcesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -133,6 +287,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -140,13 +295,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourcesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourcesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -194,7 +349,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGet(string scope, string roleAssignmentScheduleInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGet(string scope, string roleAssignmentScheduleInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -219,7 +374,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleInstancesGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -233,7 +388,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -269,11 +424,160 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleInstancesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified role assignment schedule instance. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleInstanceName = _match.Groups["roleAssignmentScheduleInstanceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/" + + roleAssignmentScheduleInstanceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleInstancesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the specified role assignment schedule instance. + /// The scope of the role assignments schedules. + /// The name (hash of schedule name + time) of the role assignment schedule + /// to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGetWithResult(string scope, string roleAssignmentScheduleInstanceName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleInstancesGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -283,7 +587,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -294,6 +598,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -301,13 +606,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -356,7 +661,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -382,7 +687,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleInstancesListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleInstancesListForScope_Call (request, onOk,onDefault,eventListener,sender); } } @@ -400,7 +705,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -436,47 +741,204 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleInstancesListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleInstancesListForScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets role assignment schedule instances of a role assignment schedule. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule instances + /// for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the current user. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances'"); + } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleInstancesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role assignment schedule instances of a role assignment schedule. + /// The scope of the role assignment schedule. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule instances + /// for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleInstancesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -524,7 +986,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancel(string scope, string roleAssignmentScheduleRequestName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancel(string scope, string roleAssignmentScheduleRequestName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -550,7 +1012,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCancel_Call (request, onOk,onDefault,eventListener,sender); } } @@ -564,7 +1026,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancelViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancelViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -575,7 +1037,7 @@ public partial class Authorization var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); } // replace URI parameters with values from identity @@ -601,12 +1063,12 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCancel_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -617,7 +1079,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -628,6 +1090,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -641,7 +1104,7 @@ public partial class Authorization default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -675,7 +1138,7 @@ public partial class Authorization } } - /// Creates a role assignment schedule request. + /// update a role assignment schedule request. /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' @@ -687,10 +1150,11 @@ public partial class Authorization /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -715,15 +1179,15 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsCreate_Call(request,onCreated,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Creates a role assignment schedule request. + /// update a role assignment schedule request. /// /// Parameters for the role assignment schedule request. /// a delegate that is called when the remote service returns 201 (Created). @@ -731,10 +1195,11 @@ public partial class Authorization /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -770,94 +1235,76 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsCreate_Call(request,onCreated,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role assignment schedule request. + /// + /// Parameters for the role assignment schedule request. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleRequestName = _match.Groups["roleAssignmentScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + roleAssignmentScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsCreateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// + /// update a role assignment schedule request. /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' /// for a resource. /// The name of the role assignment to create. It can be any valid GUID. - /// Parameters for the role assignment schedule request. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate_Validate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleAssignmentScheduleRequestName),roleAssignmentScheduleRequestName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Get the specified role assignment schedule request. - /// The scope of the role assignment schedule request. - /// The name (guid) of the role assignment schedule request to get. - /// a delegate that is called when the remote service returns 200 (OK). + /// Json string supplied to the RoleAssignmentScheduleRequestsCreate operation + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -865,7 +1312,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGet(string scope, string roleAssignmentScheduleRequestName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateViaJsonString(string scope, string roleAssignmentScheduleRequestName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -885,76 +1332,187 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Get the specified role assignment schedule request. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role assignment schedule request. + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role assignment to create. It can be any valid GUID. + /// Json string supplied to the RoleAssignmentScheduleRequestsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateViaJsonStringWithResult(string scope, string roleAssignmentScheduleRequestName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var roleAssignmentScheduleRequestName = _match.Groups["roleAssignmentScheduleRequestName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope + + (scope) + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" - + roleAssignmentScheduleRequestName + + global::System.Uri.EscapeDataString(roleAssignmentScheduleRequestName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleAssignmentScheduleRequestsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleAssignmentScheduleRequestsCreateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + /// update a role assignment schedule request. + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role assignment to create. It can be any valid GUID. + /// Parameters for the role assignment schedule request. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateWithResult(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -965,20 +1523,21 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.OK: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -994,31 +1553,72 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// - /// The scope of the role assignment schedule request. - /// The name (guid) of the role assignment schedule request to get. + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role assignment to create. It can be any valid GUID. + /// Parameters for the role assignment schedule request. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGet_Validate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate_Validate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); await eventListener.AssertNotNull(nameof(roleAssignmentScheduleRequestName),roleAssignmentScheduleRequestName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Gets role assignment schedule requests for a scope. - /// The scope of the role assignments schedule requests. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the - /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// Get the specified role assignment schedule request. + /// The scope of the role assignment schedule request. + /// The name (guid) of the role assignment schedule request to get. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGet(string scope, string roleAssignmentScheduleRequestName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentScheduleRequestsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role assignment schedule request. + /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1027,7 +1627,2209 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleRequestName = _match.Groups["roleAssignmentScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + roleAssignmentScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentScheduleRequestsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role assignment schedule request. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleRequestName = _match.Groups["roleAssignmentScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + roleAssignmentScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role assignment schedule request. + /// The scope of the role assignment schedule request. + /// The name (guid) of the role assignment schedule request to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGetWithResult(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The scope of the role assignment schedule request. + /// The name (guid) of the role assignment schedule request to get. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGet_Validate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleAssignmentScheduleRequestName),roleAssignmentScheduleRequestName); + } + } + + /// Gets role assignment schedule requests for a scope. + /// The scope of the role assignments schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentScheduleRequestsListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role assignment schedule requests for a scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentScheduleRequestsListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role assignment schedule requests for a scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role assignment schedule requests for a scope. + /// The scope of the role assignments schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The scope of the role assignments schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Get the specified role assignment schedule for a resource scope + /// The scope of the role assignment schedule. + /// The name (guid) of the role assignment schedule to get. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGet(string scope, string roleAssignmentScheduleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentSchedulesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role assignment schedule for a resource scope + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleName = _match.Groups["roleAssignmentScheduleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" + + roleAssignmentScheduleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentSchedulesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role assignment schedule for a resource scope + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleName = _match.Groups["roleAssignmentScheduleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" + + roleAssignmentScheduleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentSchedulesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role assignment schedule for a resource scope + /// The scope of the role assignment schedule. + /// The name (guid) of the role assignment schedule to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGetWithResult(string scope, string roleAssignmentScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentSchedulesGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The scope of the role assignment schedule. + /// The name (guid) of the role assignment schedule to get. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGet_Validate(string scope, string roleAssignmentScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleAssignmentScheduleName),roleAssignmentScheduleName); + } + } + + /// Gets role assignment schedules for a resource scope. + /// The scope of the role assignments schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentSchedulesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role assignment schedules for a resource scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentSchedulesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role assignment schedules for a resource scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentSchedulesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role assignment schedules for a resource scope. + /// The scope of the role assignments schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentSchedulesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The scope of the role assignments schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Gets the specified role eligibility schedule instance. + /// The scope of the role eligibility schedules. + /// The name (hash of schedule name + time) of the role eligibility schedule + /// to get. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGet(string scope, string roleEligibilityScheduleInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleInstancesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified role eligibility schedule 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.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleInstanceName = _match.Groups["roleEligibilityScheduleInstanceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" + + roleEligibilityScheduleInstanceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleInstancesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified role eligibility schedule instance. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleInstanceName = _match.Groups["roleEligibilityScheduleInstanceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" + + roleEligibilityScheduleInstanceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleInstancesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the specified role eligibility schedule instance. + /// The scope of the role eligibility schedules. + /// The name (hash of schedule name + time) of the role eligibility schedule + /// to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGetWithResult(string scope, string roleEligibilityScheduleInstanceName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleInstancesGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The scope of the role eligibility schedules. + /// The name (hash of schedule name + time) of the role eligibility schedule + /// to get. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGet_Validate(string scope, string roleEligibilityScheduleInstanceName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleInstanceName),roleEligibilityScheduleInstanceName); + } + } + + /// Gets role eligibility schedule instances of a role eligibility schedule. + /// The scope of the role eligibility schedule. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleInstancesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role eligibility schedule instances of a role eligibility schedule. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleInstancesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role eligibility schedule instances of a role eligibility schedule. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleInstancesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role eligibility schedule instances of a role eligibility schedule. + /// The scope of the role eligibility schedule. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleInstancesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The scope of the role eligibility schedule. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Cancels a pending role eligibility schedule request. + /// The scope of the role eligibility request to cancel. + /// The name of the role eligibility request to cancel. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel(string scope, string roleEligibilityScheduleRequestName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleRequestsCancel_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Cancels a pending role eligibility schedule request. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancelViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleRequestsCancel_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The scope of the role eligibility request to cancel. + /// The name of the role eligibility request to cancel. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); + } + } + + /// update a role eligibility schedule request. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Parameters for the role eligibility schedule request. + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// update a role eligibility schedule request. + /// + /// Parameters for the role eligibility schedule request. + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// update a role eligibility schedule request. + /// + /// Parameters for the role eligibility schedule request. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleRequestsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// update a role eligibility schedule request. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Json string supplied to the RoleEligibilityScheduleRequestsCreate operation + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreateViaJsonString(string scope, string roleEligibilityScheduleRequestName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1037,10 +3839,9 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1048,75 +3849,179 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Gets role assignment schedule requests for a scope. - /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the - /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role eligibility schedule request. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Json string supplied to the RoleEligibilityScheduleRequestsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreateViaJsonStringWithResult(string scope, string roleEligibilityScheduleRequestName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleRequestsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// update a role eligibility schedule request. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Parameters for the role eligibility schedule request. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreateWithResult(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleAssignmentScheduleRequestsListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsCreateWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// 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.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1124,7 +4029,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1135,20 +4040,21 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.OK: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1164,31 +4070,33 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// - /// The scope of the role assignments schedule requests. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the - /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Parameters for the role eligibility schedule request. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get the specified role assignment schedule for a resource scope - /// The scope of the role assignment schedule. - /// The name (guid) of the role assignment schedule to get. + /// Get the specified role eligibility schedule request. + /// The scope of the role eligibility schedule request. + /// The name (guid) of the role eligibility schedule request to get. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1197,7 +4105,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGet(string scope, string roleAssignmentScheduleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet(string scope, string roleEligibilityScheduleRequestName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1207,8 +4115,8 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" - + global::System.Uri.EscapeDataString(roleAssignmentScheduleName) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1222,11 +4130,11 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentSchedulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the specified role assignment schedule for a resource scope + /// Get the specified role eligibility schedule request. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1236,7 +4144,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1244,21 +4152,21 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleAssignmentScheduleName = _match.Groups["roleAssignmentScheduleName"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" - + roleAssignmentScheduleName + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1272,177 +4180,159 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentSchedulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Get the specified role eligibility schedule request. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The scope of the role assignment schedule. - /// The name (guid) of the role assignment schedule to get. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGet_Validate(string scope, string roleAssignmentScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleAssignmentScheduleName),roleAssignmentScheduleName); - } - } - /// Gets role assignment schedules for a resource scope. - /// The scope of the role assignments schedules. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the - /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) - { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleAssignmentSchedulesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsGetWithResult_Call (request, eventListener,sender); } } - /// Gets role assignment schedules for a resource scope. - /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the - /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Get the specified role eligibility schedule request. + /// The scope of the role eligibility schedule request. + /// The name (guid) of the role eligibility schedule request to get. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGetWithResult(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleAssignmentSchedulesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1452,7 +4342,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1463,6 +4353,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1470,13 +4361,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1492,31 +4383,31 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but you + /// Validation method for method. Call this like the actual call, but you /// will get validation events back. /// - /// The scope of the role assignments schedules. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the - /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// The scope of the role eligibility schedule request. + /// The name (guid) of the role eligibility schedule request to get. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); } } - /// Gets the specified role eligibility schedule instance. - /// The scope of the role eligibility schedules. - /// The name (hash of schedule name + time) of the role eligibility schedule - /// to get. + /// Gets role eligibility schedule requests for a scope. + /// The scope of the role eligibility schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1525,7 +4416,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGet(string scope, string roleEligibilityScheduleInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1535,9 +4426,10 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleInstanceName) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1550,12 +4442,17 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsListForScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the specified role eligibility schedule instance. + /// Gets role eligibility schedule requests for a scope. /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1564,7 +4461,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1572,22 +4469,22 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleInstanceName = _match.Groups["roleEligibilityScheduleInstanceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" - + roleEligibilityScheduleInstanceName + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1600,179 +4497,170 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsListForScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets role eligibility schedule requests for a scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The scope of the role eligibility schedules. - /// The name (hash of schedule name + time) of the role eligibility schedule - /// to get. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGet_Validate(string scope, string roleEligibilityScheduleInstanceName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleInstanceName),roleEligibilityScheduleInstanceName); - } - } - /// Gets role eligibility schedule instances of a role eligibility schedule. - /// The scope of the role eligibility schedule. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) - { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + "?" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilityScheduleInstancesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsListForScopeWithResult_Call (request, eventListener,sender); } } - /// Gets role eligibility schedule instances of a role eligibility schedule. - /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets role eligibility schedule requests for a scope. + /// The scope of the role eligibility schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) - { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + "?" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilityScheduleInstancesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -1783,7 +4671,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1794,6 +4682,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1801,13 +4690,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1823,19 +4712,20 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, + /// Validation method for method. Call this like the actual call, /// but you will get validation events back. /// - /// The scope of the role eligibility schedule. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// The scope of the role eligibility schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1844,9 +4734,9 @@ public partial class Authorization } } - /// Cancels a pending role eligibility schedule request. - /// The scope of the role eligibility request to cancel. - /// The name of the role eligibility request to cancel. + /// Get the specified role eligibility schedule for a resource scope + /// The scope of the role eligibility schedule. + /// The name (guid) of the role eligibility schedule to get. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1855,7 +4745,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel(string scope, string roleEligibilityScheduleRequestName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet(string scope, string roleEligibilityScheduleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1865,9 +4755,8 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) - + "/cancel" + + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1876,16 +4765,16 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilitySchedulesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Cancels a pending role eligibility schedule request. + /// Get the specified role eligibility schedule for a resource scope /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1895,7 +4784,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancelViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1903,22 +4792,21 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + var roleEligibilityScheduleName = _match.Groups["roleEligibilityScheduleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + roleEligibilityScheduleRequestName - + "/cancel" + + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" + + roleEligibilityScheduleName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1927,19 +4815,165 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilitySchedulesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role eligibility schedule for a resource scope + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleName = _match.Groups["roleEligibilityScheduleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" + + roleEligibilityScheduleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilitySchedulesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role eligibility schedule for a resource scope + /// The scope of the role eligibility schedule. + /// The name (guid) of the role eligibility schedule to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGetWithResult(string scope, string roleEligibilityScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilitySchedulesGetWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1948,7 +4982,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1959,6 +4993,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1966,13 +5001,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1988,32 +5023,75 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// - /// The scope of the role eligibility request to cancel. - /// The name of the role eligibility request to cancel. + /// The scope of the role eligibility schedule. + /// The name (guid) of the role eligibility schedule to get. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet_Validate(string scope, string roleEligibilityScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleName),roleEligibilityScheduleName); } } - /// Creates a role eligibility schedule request. - /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. - /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' - /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - /// for a resource. - /// The name of the role eligibility to create. It can be any valid GUID. - /// Parameters for the role eligibility schedule request. - /// a delegate that is called when the remote service returns 201 (Created). + /// Gets role eligibility schedules for a resource scope. + /// The scope of the role eligibility schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilitySchedulesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role eligibility schedules for a resource scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2021,19 +5099,30 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + scope + + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2041,31 +5130,28 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsCreate_Call(request,onCreated,onDefault,eventListener,sender); + await this.RoleEligibilitySchedulesListForScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Creates a role eligibility schedule request. + /// Gets role eligibility schedules for a resource scope. /// - /// Parameters for the role eligibility schedule request. - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2073,47 +5159,147 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + roleEligibilityScheduleRequestName + + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilitySchedulesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role eligibility schedules for a resource scope. + /// The scope of the role eligibility schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilityScheduleRequestsCreate_Call(request,onCreated,onDefault,eventListener,sender); + return await this.RoleEligibilitySchedulesListForScopeWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 201 (Created). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2121,7 +5307,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2132,20 +5318,21 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.Created: + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2161,34 +5348,32 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but + /// Validation method for method. Call this like the actual call, but /// you will get validation events back. /// - /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. - /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' - /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - /// for a resource. - /// The name of the role eligibility to create. It can be any valid GUID. - /// Parameters for the role eligibility schedule request. + /// The scope of the role eligibility schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(Filter),Filter); } } - /// Get the specified role eligibility schedule request. - /// The scope of the role eligibility schedule request. - /// The name (guid) of the role eligibility schedule request to get. + /// Delete a role management policy + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2196,7 +5381,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet(string scope, string roleEligibilityScheduleRequestName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete(string scope, string roleManagementPolicyName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2206,8 +5391,8 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2216,18 +5401,19 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Get the specified role eligibility schedule request. + /// Delete a role management policy /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2235,7 +5421,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesDeleteViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2243,21 +5429,21 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + roleEligibilityScheduleRequestName + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + roleManagementPolicyName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2266,18 +5452,19 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage 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. @@ -2285,7 +5472,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2296,6 +5483,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2303,13 +5491,19 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2325,31 +5519,66 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// - /// The scope of the role eligibility schedule request. - /// The name (guid) of the role eligibility schedule request to get. + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); + await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); } } - /// Gets role eligibility schedule requests for a scope. - /// The scope of the role eligibility schedule requests. - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the - /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. + /// Get the specified role management policy for a resource scope + /// The scope of the role management policy. + /// The name (guid) of the role management policy to get. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleManagementPoliciesGet(string scope, string roleManagementPolicyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleManagementPoliciesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role management policy for a resource scope + /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2358,20 +5587,30 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + roleManagementPolicyName + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2384,26 +5623,19 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets role eligibility schedule requests for a scope. + /// Get the specified role management policy for a resource scope /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the - /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2411,42 +5643,140 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; + var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + roleManagementPolicyName + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPoliciesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role management policy for a resource scope + /// The scope of the role management policy. + /// The name (guid) of the role management policy to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleManagementPoliciesGetWithResult(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilityScheduleRequestsListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleManagementPoliciesGetWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2455,7 +5785,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2466,6 +5796,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2473,13 +5804,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2495,31 +5826,26 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// - /// The scope of the role eligibility schedule requests. - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the - /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. + /// The scope of the role management policy. + /// The name (guid) of the role management policy to get. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesGet_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); } } - /// Get the specified role eligibility schedule for a resource scope - /// The scope of the role eligibility schedule. - /// The name (guid) of the role eligibility schedule to get. + /// Gets role management policies for a resource scope. + /// The scope of the role management policy. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2528,7 +5854,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet(string scope, string roleEligibilityScheduleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2538,8 +5864,7 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleName) + + "/providers/Microsoft.Authorization/roleManagementPolicies" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2553,11 +5878,11 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilitySchedulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesListForScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the specified role eligibility schedule for a resource scope + /// Gets role management policies for a resource scope. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2567,7 +5892,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScopeViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2575,21 +5900,19 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleName = _match.Groups["roleEligibilityScheduleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" - + roleEligibilityScheduleName + + "/providers/Microsoft.Authorization/roleManagementPolicies" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2603,180 +5926,156 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilitySchedulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesListForScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets role management policies for a resource scope. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The scope of the role eligibility schedule. - /// The name (guid) of the role eligibility schedule to get. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet_Validate(string scope, string roleEligibilityScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleName),roleEligibilityScheduleName); - } - } - /// Gets role eligibility schedules for a resource scope. - /// The scope of the role eligibility schedules. - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) - { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicies" + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilitySchedulesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleManagementPoliciesListForScopeWithResult_Call (request, eventListener,sender); } } - /// Gets role eligibility schedules for a resource scope. - /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets role management policies for a resource scope. + /// The scope of the role management policy. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScopeWithResult(string scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicies" + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilitySchedulesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleManagementPoliciesListForScopeWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2785,7 +6084,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2796,6 +6095,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2803,13 +6103,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2825,40 +6125,36 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// - /// The scope of the role eligibility schedules. - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// The scope of the role management policy. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Filter),Filter); } } - /// Delete a role management policy + /// update a role management policy /// The scope of the role management policy to upsert. /// The name (guid) of the role management policy to upsert. + /// Parameters for the role management policy. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete(string scope, string roleManagementPolicyName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2878,27 +6174,32 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RoleManagementPoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a role management policy + /// update a role management policy /// + /// Parameters for the role management policy. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesDeleteViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2929,93 +6230,77 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RoleManagementPoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage 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). + /// update a role management policy + /// + /// Parameters for the role management policy. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + roleManagementPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPoliciesUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// + /// update a role management policy /// The scope of the role management policy to upsert. /// The name (guid) of the role management policy to upsert. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); - } - } - - /// Get the specified role management policy for a resource scope - /// The scope of the role management policy. - /// The name (guid) of the role management policy to get. + /// Json string supplied to the RoleManagementPoliciesUpdate 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). @@ -3024,7 +6309,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesGet(string scope, string roleManagementPolicyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateViaJsonString(string scope, string roleManagementPolicyName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3044,144 +6329,74 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the specified role management policy for a resource scope - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role management policy + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. + /// Json string supplied to the RoleManagementPoliciesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateViaJsonStringWithResult(string scope, string roleManagementPolicyName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope + + (scope) + "/providers/Microsoft.Authorization/roleManagementPolicies/" - + roleManagementPolicyName + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.RoleManagementPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The scope of the role management policy. - /// The name (guid) of the role management policy to get. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesGet_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPoliciesUpdateWithResult_Call (request, eventListener,sender); } } - /// Gets role management policies for a resource scope. - /// The scope of the role management policy. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role management policy + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. + /// Parameters for the role management policy. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateWithResult(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3191,73 +6406,92 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleManagementPolicies" + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleManagementPoliciesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleManagementPoliciesUpdateWithResult_Call (request, eventListener,sender); } } - /// Gets role management policies for a resource scope. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScopeViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + scope - + "/providers/Microsoft.Authorization/roleManagementPolicies" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.RoleManagementPoliciesListForScope_Call(request,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3267,7 +6501,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3278,6 +6512,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3285,13 +6520,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3307,35 +6542,42 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// - /// The scope of the role management policy. + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. + /// Parameters for the role management policy. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Update a role management policy - /// The scope of the role management policy to upsert. - /// The name (guid) of the role management policy to upsert. - /// Parameters for the role management policy. - /// a delegate that is called when the remote service returns 200 (OK). + /// update a role management policy assignment + /// The scope of the role management policy assignment to upsert. + /// The name of format {guid_guid} the role management policy assignment + /// to upsert. + /// Parameters for the role management policy assignment. + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3345,8 +6587,8 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleManagementPolicies/" - + global::System.Uri.EscapeDataString(roleManagementPolicyName) + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + global::System.Uri.EscapeDataString(roleManagementPolicyAssignmentName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3355,31 +6597,32 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Update a role management policy + /// update a role management policy assignment /// - /// Parameters for the role management policy. - /// a delegate that is called when the remote service returns 200 (OK). + /// Parameters for the role management policy assignment. + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3387,21 +6630,21 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; + var roleManagementPolicyAssignmentName = _match.Groups["roleManagementPolicyAssignmentName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleManagementPolicies/" - + roleManagementPolicyName + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + roleManagementPolicyAssignmentName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3410,95 +6653,78 @@ public partial class Authorization // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role management policy assignment + /// + /// Parameters for the role management policy assignment. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The scope of the role management policy to upsert. - /// The name (guid) of the role management policy to upsert. - /// Parameters for the role management policy. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleManagementPolicyAssignmentName = _match.Groups["roleManagementPolicyAssignmentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + roleManagementPolicyAssignmentName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsCreateWithResult_Call (request, eventListener,sender); } } - /// Create a role management policy assignment + /// update a role management policy assignment /// The scope of the role management policy assignment to upsert. /// The name of format {guid_guid} the role management policy assignment /// to upsert. - /// Parameters for the role management policy assignment. + /// Json string supplied to the RoleManagementPolicyAssignmentsCreate operation /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -3507,7 +6733,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaJsonString(string scope, string roleManagementPolicyAssignmentName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3532,71 +6758,167 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsCreate_Call(request,onCreated,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Create a role management policy assignment - /// - /// Parameters for the role management policy assignment. - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role management policy assignment + /// The scope of the role management policy assignment to upsert. + /// The name of format {guid_guid} the role management policy assignment + /// to upsert. + /// Json string supplied to the RoleManagementPolicyAssignmentsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaJsonStringWithResult(string scope, string roleManagementPolicyAssignmentName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + global::System.Uri.EscapeDataString(roleManagementPolicyAssignmentName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var roleManagementPolicyAssignmentName = _match.Groups["roleManagementPolicyAssignmentName"].Value; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// update a role management policy assignment + /// The scope of the role management policy assignment to upsert. + /// The name of format {guid_guid} the role management policy assignment + /// to upsert. + /// Parameters for the role management policy assignment. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateWithResult(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope + + (scope) + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" - + roleManagementPolicyAssignmentName + + global::System.Uri.EscapeDataString(roleManagementPolicyAssignmentName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleManagementPolicyAssignmentsCreate_Call(request,onCreated,onDefault,eventListener,sender); + return await this.RoleManagementPolicyAssignmentsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 201 (Created). @@ -3607,7 +6929,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3618,6 +6940,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3625,13 +6948,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3658,7 +6981,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate_Validate(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate_Validate(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3682,7 +7005,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDelete(string scope, string roleManagementPolicyAssignmentName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDelete(string scope, string roleManagementPolicyAssignmentName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3707,7 +7030,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -3722,7 +7045,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDeleteViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDeleteViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3758,12 +7081,12 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -3775,7 +7098,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDelete_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDelete_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3786,6 +7109,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3805,7 +7129,7 @@ public partial class Authorization default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3852,7 +7176,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGet(string scope, string roleManagementPolicyAssignmentName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGet(string scope, string roleManagementPolicyAssignmentName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3877,7 +7201,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -3891,7 +7215,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3927,11 +7251,160 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role management policy assignment for a resource scope + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleManagementPolicyAssignmentName = _match.Groups["roleManagementPolicyAssignmentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + roleManagementPolicyAssignmentName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role management policy assignment for a resource scope + /// The scope of the role management policy. + /// The name of format {guid_guid} the role management policy assignment + /// to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGetWithResult(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + global::System.Uri.EscapeDataString(roleManagementPolicyAssignmentName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3941,7 +7414,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3952,6 +7425,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3959,13 +7433,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4010,7 +7484,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -4034,7 +7508,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsListForScope_Call (request, onOk,onDefault,eventListener,sender); } } @@ -4048,7 +7522,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScopeViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScopeViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -4082,12 +7556,156 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role management assignment policies for a resource scope. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role management assignment policies for a resource scope. + /// The scope of the role management policy. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScopeWithResult(string scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -4098,7 +7716,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4109,6 +7727,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4116,13 +7735,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.PowerShell.cs deleted file mode 100644 index 764a6ef37119..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.PowerShell.cs +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesTypeConverter))] - public partial class ExpandedProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ExpandedProperties(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.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ExpandedProperties(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ExpandedProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("RoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Principal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Principal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("Principal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Principal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalType, 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 ExpandedProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("RoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Principal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Principal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("Principal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Principal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalType, 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.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesTypeConverter))] - public partial interface IExpandedProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.PowerShell.cs deleted file mode 100644 index b6e1672d348b..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.PowerShell.cs +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesTypeConverter))] - public partial class PolicyAssignmentProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PolicyAssignmentProperties(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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PolicyAssignmentProperties(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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PolicyAssignmentProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("RoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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 PolicyAssignmentProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("RoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesTypeConverter))] - public partial interface IPolicyAssignmentProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.PowerShell.cs deleted file mode 100644 index bfae1572d12b..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.PowerShell.cs +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role Assignment schedule - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleTypeConverter))] - public partial class RoleAssignmentSchedule - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentSchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentSchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentSchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RequestId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentSchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RequestId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role Assignment schedule - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleTypeConverter))] - public partial interface IRoleAssignmentSchedule - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.PowerShell.cs deleted file mode 100644 index 4636da5850cf..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.PowerShell.cs +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Information about current or upcoming role assignment schedule instance - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceTypeConverter))] - public partial class RoleAssignmentScheduleInstance - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("OriginRoleAssignmentId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("OriginRoleAssignmentId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Information about current or upcoming role assignment schedule instance - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceTypeConverter))] - public partial interface IRoleAssignmentScheduleInstance - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.PowerShell.cs deleted file mode 100644 index 766a2f8febae..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.PowerShell.cs +++ /dev/null @@ -1,381 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role assignment schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstancePropertiesTypeConverter))] - public partial class RoleAssignmentScheduleInstanceProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleInstanceProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleInstanceProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleInstanceProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("OriginRoleAssignmentId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleInstanceProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("OriginRoleAssignmentId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role assignment schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstancePropertiesTypeConverter))] - public partial interface IRoleAssignmentScheduleInstanceProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.PowerShell.cs deleted file mode 100644 index 63fbdf48a965..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.PowerShell.cs +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role assignment schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentSchedulePropertiesTypeConverter))] - public partial class RoleAssignmentScheduleProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleAssignmentScheduleRequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId = (string) content.GetValueForProperty("RoleAssignmentScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleAssignmentScheduleRequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId = (string) content.GetValueForProperty("RoleAssignmentScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role assignment schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentSchedulePropertiesTypeConverter))] - public partial interface IRoleAssignmentScheduleProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.PowerShell.cs deleted file mode 100644 index 31f242acdac4..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.PowerShell.cs +++ /dev/null @@ -1,474 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role Assignment schedule request - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestTypeConverter))] - public partial class RoleAssignmentScheduleRequest - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration, 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 RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role Assignment schedule request - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestTypeConverter))] - public partial interface IRoleAssignmentScheduleRequest - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.PowerShell.cs deleted file mode 100644 index 0bfe4f1c1bd2..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.PowerShell.cs +++ /dev/null @@ -1,445 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role assignment schedule request properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTypeConverter))] - public partial class RoleAssignmentScheduleRequestProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleRequestProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleRequestProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleRequestProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration, 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 RoleAssignmentScheduleRequestProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role assignment schedule request properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTypeConverter))] - public partial interface IRoleAssignmentScheduleRequestProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.PowerShell.cs deleted file mode 100644 index 1162ac715df1..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.PowerShell.cs +++ /dev/null @@ -1,386 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role eligibility schedule - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleTypeConverter))] - public partial class RoleEligibilitySchedule - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilitySchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilitySchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilitySchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RequestId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilitySchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RequestId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role eligibility schedule - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleTypeConverter))] - public partial interface IRoleEligibilitySchedule - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.PowerShell.cs deleted file mode 100644 index 31b4a4fb9fc9..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.PowerShell.cs +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Information about current or upcoming role eligibility schedule instance - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceTypeConverter))] - public partial class RoleEligibilityScheduleInstance - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Information about current or upcoming role eligibility schedule instance - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceTypeConverter))] - public partial interface IRoleEligibilityScheduleInstance - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.PowerShell.cs deleted file mode 100644 index ebfb94e93efb..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.PowerShell.cs +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role eligibility schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstancePropertiesTypeConverter))] - public partial class RoleEligibilityScheduleInstanceProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleInstanceProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleInstanceProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleInstanceProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleInstanceProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role eligibility schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstancePropertiesTypeConverter))] - public partial interface IRoleEligibilityScheduleInstanceProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.PowerShell.cs deleted file mode 100644 index 5a7fc8da4e86..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.PowerShell.cs +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role eligibility schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilitySchedulePropertiesTypeConverter))] - public partial class RoleEligibilityScheduleProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleEligibilityScheduleRequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId = (string) content.GetValueForProperty("RoleEligibilityScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId, global::System.Convert.ToString); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleEligibilityScheduleRequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId = (string) content.GetValueForProperty("RoleEligibilityScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId, global::System.Convert.ToString); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role eligibility schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilitySchedulePropertiesTypeConverter))] - public partial interface IRoleEligibilityScheduleProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.PowerShell.cs deleted file mode 100644 index 3eca8b95fda5..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.PowerShell.cs +++ /dev/null @@ -1,466 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role Eligibility schedule request - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestTypeConverter))] - public partial class RoleEligibilityScheduleRequest - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration, 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 RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role Eligibility schedule request - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestTypeConverter))] - public partial interface IRoleEligibilityScheduleRequest - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.PowerShell.cs deleted file mode 100644 index dd3abfc1452a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.PowerShell.cs +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role eligibility schedule request properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTypeConverter))] - public partial class RoleEligibilityScheduleRequestProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleRequestProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleRequestProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleRequestProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration, 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 RoleEligibilityScheduleRequestProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role eligibility schedule request properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTypeConverter))] - public partial interface IRoleEligibilityScheduleRequestProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.PowerShell.cs deleted file mode 100644 index 10f7827fa22a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.PowerShell.cs +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role management policy - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyTypeConverter))] - public partial class RoleManagementPolicy - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicy(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicy(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicy(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PolicyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IsOrganizationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("EffectiveRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).EffectiveRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeType, 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 RoleManagementPolicy(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PolicyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IsOrganizationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("EffectiveRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).EffectiveRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role management policy - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyTypeConverter))] - public partial interface IRoleManagementPolicy - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.PowerShell.cs deleted file mode 100644 index b4bf58f3ee6d..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.PowerShell.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// The role management policy rule. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyApprovalRuleTypeConverter))] - public partial class RoleManagementPolicyApprovalRule - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyApprovalRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyApprovalRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyApprovalRule(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Setting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("TargetCaller")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); - } - if (content.Contains("TargetOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); - } - if (content.Contains("TargetObject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetInheritableSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetEnforcedSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("RuleType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); - } - if (content.Contains("SettingApprovalMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode?) content.GetValueForProperty("SettingApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode.CreateFrom); - } - if (content.Contains("SettingIsApprovalRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired = (bool?) content.GetValueForProperty("SettingIsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingIsApprovalRequiredForExtension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("SettingIsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingIsRequestorJustificationRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired = (bool?) content.GetValueForProperty("SettingIsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingApprovalStage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[]) content.GetValueForProperty("SettingApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStageTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RoleManagementPolicyApprovalRule(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Setting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("TargetCaller")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); - } - if (content.Contains("TargetOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); - } - if (content.Contains("TargetObject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetInheritableSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetEnforcedSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("RuleType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); - } - if (content.Contains("SettingApprovalMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode?) content.GetValueForProperty("SettingApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode.CreateFrom); - } - if (content.Contains("SettingIsApprovalRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired = (bool?) content.GetValueForProperty("SettingIsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingIsApprovalRequiredForExtension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("SettingIsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingIsRequestorJustificationRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired = (bool?) content.GetValueForProperty("SettingIsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingApprovalStage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[]) content.GetValueForProperty("SettingApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStageTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The role management policy rule. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyApprovalRuleTypeConverter))] - public partial interface IRoleManagementPolicyApprovalRule - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.PowerShell.cs deleted file mode 100644 index e403e541e57b..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.PowerShell.cs +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role management policy - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentTypeConverter))] - public partial class RoleManagementPolicyAssignment - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyAssignment(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyAssignment(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyAssignment(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesPolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail, 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 RoleManagementPolicyAssignment(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesPolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role management policy - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentTypeConverter))] - public partial interface IRoleManagementPolicyAssignment - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.PowerShell.cs deleted file mode 100644 index 2acbad65ae65..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.PowerShell.cs +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role management policy assignment properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentPropertiesTypeConverter))] - public partial class RoleManagementPolicyAssignmentProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyAssignmentProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyAssignmentProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyAssignmentProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PolicyAssignmentProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesPolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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 RoleManagementPolicyAssignmentProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PolicyAssignmentProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesPolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role management policy assignment properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentPropertiesTypeConverter))] - public partial interface IRoleManagementPolicyAssignmentProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.PowerShell.cs deleted file mode 100644 index 394023bc7420..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.PowerShell.cs +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// The role management policy rule. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyNotificationRuleTypeConverter))] - public partial class RoleManagementPolicyNotificationRule - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyNotificationRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyNotificationRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyNotificationRule(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("NotificationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism?) content.GetValueForProperty("NotificationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism.CreateFrom); - } - if (content.Contains("NotificationLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel?) content.GetValueForProperty("NotificationLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel.CreateFrom); - } - if (content.Contains("RecipientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType?) content.GetValueForProperty("RecipientType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType.CreateFrom); - } - if (content.Contains("NotificationRecipient")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient = (string[]) content.GetValueForProperty("NotificationRecipient",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("IsDefaultRecipientsEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled = (bool?) content.GetValueForProperty("IsDefaultRecipientsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TargetCaller")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); - } - if (content.Contains("TargetOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); - } - if (content.Contains("TargetObject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetInheritableSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetEnforcedSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("RuleType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RoleManagementPolicyNotificationRule(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("NotificationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism?) content.GetValueForProperty("NotificationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism.CreateFrom); - } - if (content.Contains("NotificationLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel?) content.GetValueForProperty("NotificationLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel.CreateFrom); - } - if (content.Contains("RecipientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType?) content.GetValueForProperty("RecipientType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType.CreateFrom); - } - if (content.Contains("NotificationRecipient")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient = (string[]) content.GetValueForProperty("NotificationRecipient",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("IsDefaultRecipientsEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled = (bool?) content.GetValueForProperty("IsDefaultRecipientsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TargetCaller")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); - } - if (content.Contains("TargetOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); - } - if (content.Contains("TargetObject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetInheritableSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetEnforcedSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("RuleType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); - } - 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The role management policy rule. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyNotificationRuleTypeConverter))] - public partial interface IRoleManagementPolicyNotificationRule - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.PowerShell.cs deleted file mode 100644 index 88cece8c2a13..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.PowerShell.cs +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role management policy properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyPropertiesTypeConverter))] - public partial class RoleManagementPolicyProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IsOrganizationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("EffectiveRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeType, 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 RoleManagementPolicyProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IsOrganizationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("EffectiveRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role management policy properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyPropertiesTypeConverter))] - public partial interface IRoleManagementPolicyProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.PowerShell.cs similarity index 60% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.PowerShell.cs index 8850320298d5..f406048b5fd7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ApprovalSettings partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of 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. @@ -70,29 +78,29 @@ internal ApprovalSettings(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("IsApprovalRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequired = (bool?) content.GetValueForProperty("IsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequired = (bool?) content.GetValueForProperty("IsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsApprovalRequiredForExtension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("IsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("IsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsRequestorJustificationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsRequestorJustificationRequired = (bool?) content.GetValueForProperty("IsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsRequestorJustificationRequired = (bool?) content.GetValueForProperty("IsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ApprovalMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalMode = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode?) content.GetValueForProperty("ApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalMode, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalMode = (string) content.GetValueForProperty("ApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalMode, global::System.Convert.ToString); } if (content.Contains("ApprovalStage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalStage = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[]) content.GetValueForProperty("ApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalStage = (System.Collections.Generic.List) content.GetValueForProperty("ApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalStage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStageTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,51 +115,49 @@ internal ApprovalSettings(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("IsApprovalRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequired = (bool?) content.GetValueForProperty("IsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequired = (bool?) content.GetValueForProperty("IsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsApprovalRequiredForExtension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("IsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("IsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsRequestorJustificationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsRequestorJustificationRequired = (bool?) content.GetValueForProperty("IsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsRequestorJustificationRequired = (bool?) content.GetValueForProperty("IsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ApprovalMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalMode = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode?) content.GetValueForProperty("ApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalMode, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalMode = (string) content.GetValueForProperty("ApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalMode, global::System.Convert.ToString); } if (content.Contains("ApprovalStage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalStage = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[]) content.GetValueForProperty("ApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalStage = (System.Collections.Generic.List) content.GetValueForProperty("ApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalStage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStageTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApprovalSettings(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApprovalSettings(content); } @@ -161,12 +167,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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 approval settings. [System.ComponentModel.TypeConverter(typeof(ApprovalSettingsTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.TypeConverter.cs index 375048951acd..fb2951f965fd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.cs similarity index 77% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.cs index ac42050924ce..ee63edb6d131 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.cs @@ -3,29 +3,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The approval settings. public partial class ApprovalSettings : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? _approvalMode; + private string _approvalMode; /// The type of rule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? ApprovalMode { get => this._approvalMode; set => this._approvalMode = value; } + public string ApprovalMode { get => this._approvalMode; set => this._approvalMode = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] _approvalStage; + private System.Collections.Generic.List _approvalStage; /// The approval stages of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] ApprovalStage { get => this._approvalStage; set => this._approvalStage = value; } + public System.Collections.Generic.List ApprovalStage { get => this._approvalStage; set => this._approvalStage = value; } /// Backing field for property. private bool? _isApprovalRequired; @@ -62,22 +62,32 @@ public partial interface IApprovalSettings : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of rule", SerializedName = @"approvalMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? ApprovalMode { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("SingleStage", "Serial", "Parallel", "NoApproval")] + string ApprovalMode { get; set; } /// The approval stages of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The approval stages of the request.", SerializedName = @"approvalStages", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] ApprovalStage { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage) })] + System.Collections.Generic.List ApprovalStage { get; set; } /// Determine whether approval is required or not. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approval is required or not.", SerializedName = @"isApprovalRequired", PossibleTypes = new [] { typeof(bool) })] @@ -86,6 +96,9 @@ public partial interface IApprovalSettings : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approval is required for assignment extension.", SerializedName = @"isApprovalRequiredForExtension", PossibleTypes = new [] { typeof(bool) })] @@ -94,6 +107,9 @@ public partial interface IApprovalSettings : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether requestor justification required.", SerializedName = @"isRequestorJustificationRequired", PossibleTypes = new [] { typeof(bool) })] @@ -105,9 +121,10 @@ internal partial interface IApprovalSettingsInternal { /// The type of rule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? ApprovalMode { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("SingleStage", "Serial", "Parallel", "NoApproval")] + string ApprovalMode { get; set; } /// The approval stages of the request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] ApprovalStage { get; set; } + System.Collections.Generic.List ApprovalStage { get; set; } /// Determine whether approval is required or not. bool? IsApprovalRequired { get; set; } /// Determine whether approval is required for assignment extension. diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.json.cs similarity index 90% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.json.cs index 82b0e44c7b06..da998af968f8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ApprovalSettings(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authoriza { return; } - {_isApprovalRequired = If( json?.PropertyT("isApprovalRequired"), out var __jsonIsApprovalRequired) ? (bool?)__jsonIsApprovalRequired : IsApprovalRequired;} - {_isApprovalRequiredForExtension = If( json?.PropertyT("isApprovalRequiredForExtension"), out var __jsonIsApprovalRequiredForExtension) ? (bool?)__jsonIsApprovalRequiredForExtension : IsApprovalRequiredForExtension;} - {_isRequestorJustificationRequired = If( json?.PropertyT("isRequestorJustificationRequired"), out var __jsonIsRequestorJustificationRequired) ? (bool?)__jsonIsRequestorJustificationRequired : IsRequestorJustificationRequired;} - {_approvalMode = If( json?.PropertyT("approvalMode"), out var __jsonApprovalMode) ? (string)__jsonApprovalMode : (string)ApprovalMode;} - {_approvalStage = If( json?.PropertyT("approvalStages"), out var __jsonApprovalStages) ? If( __jsonApprovalStages as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IApprovalStage) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStage.FromJson(__u) )) ))() : null : ApprovalStage;} + {_isApprovalRequired = If( json?.PropertyT("isApprovalRequired"), out var __jsonIsApprovalRequired) ? (bool?)__jsonIsApprovalRequired : _isApprovalRequired;} + {_isApprovalRequiredForExtension = If( json?.PropertyT("isApprovalRequiredForExtension"), out var __jsonIsApprovalRequiredForExtension) ? (bool?)__jsonIsApprovalRequiredForExtension : _isApprovalRequiredForExtension;} + {_isRequestorJustificationRequired = If( json?.PropertyT("isRequestorJustificationRequired"), out var __jsonIsRequestorJustificationRequired) ? (bool?)__jsonIsRequestorJustificationRequired : _isRequestorJustificationRequired;} + {_approvalMode = If( json?.PropertyT("approvalMode"), out var __jsonApprovalMode) ? (string)__jsonApprovalMode : (string)_approvalMode;} + {_approvalStage = If( json?.PropertyT("approvalStages"), out var __jsonApprovalStages) ? If( __jsonApprovalStages as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStage.FromJson(__u) )) ))() : null : _approvalStage;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ApprovalSettings(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.PowerShell.cs similarity index 56% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.PowerShell.cs index 217a950875f0..b1b9f4dd1dcd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ApprovalStage partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of 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. @@ -70,33 +78,33 @@ internal ApprovalStage(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("TimeOutInDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).TimeOutInDay = (int?) content.GetValueForProperty("TimeOutInDay",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).TimeOutInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).TimeOutInDay = (int?) content.GetValueForProperty("TimeOutInDay",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).TimeOutInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("IsApproverJustificationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsApproverJustificationRequired = (bool?) content.GetValueForProperty("IsApproverJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsApproverJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsApproverJustificationRequired = (bool?) content.GetValueForProperty("IsApproverJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsApproverJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EscalationTimeInMinute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationTimeInMinute = (int?) content.GetValueForProperty("EscalationTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationTimeInMinute = (int?) content.GetValueForProperty("EscalationTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("PrimaryApprover")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).PrimaryApprover = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[]) content.GetValueForProperty("PrimaryApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).PrimaryApprover, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).PrimaryApprover = (System.Collections.Generic.List) content.GetValueForProperty("PrimaryApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).PrimaryApprover, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSetTypeConverter.ConvertFrom)); } if (content.Contains("IsEscalationEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsEscalationEnabled = (bool?) content.GetValueForProperty("IsEscalationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsEscalationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsEscalationEnabled = (bool?) content.GetValueForProperty("IsEscalationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsEscalationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EscalationApprover")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationApprover = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[]) content.GetValueForProperty("EscalationApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationApprover, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationApprover = (System.Collections.Generic.List) content.GetValueForProperty("EscalationApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationApprover, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSetTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -111,55 +119,53 @@ internal ApprovalStage(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("TimeOutInDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).TimeOutInDay = (int?) content.GetValueForProperty("TimeOutInDay",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).TimeOutInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).TimeOutInDay = (int?) content.GetValueForProperty("TimeOutInDay",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).TimeOutInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("IsApproverJustificationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsApproverJustificationRequired = (bool?) content.GetValueForProperty("IsApproverJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsApproverJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsApproverJustificationRequired = (bool?) content.GetValueForProperty("IsApproverJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsApproverJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EscalationTimeInMinute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationTimeInMinute = (int?) content.GetValueForProperty("EscalationTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationTimeInMinute = (int?) content.GetValueForProperty("EscalationTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("PrimaryApprover")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).PrimaryApprover = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[]) content.GetValueForProperty("PrimaryApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).PrimaryApprover, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).PrimaryApprover = (System.Collections.Generic.List) content.GetValueForProperty("PrimaryApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).PrimaryApprover, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSetTypeConverter.ConvertFrom)); } if (content.Contains("IsEscalationEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsEscalationEnabled = (bool?) content.GetValueForProperty("IsEscalationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsEscalationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsEscalationEnabled = (bool?) content.GetValueForProperty("IsEscalationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsEscalationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EscalationApprover")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationApprover = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[]) content.GetValueForProperty("EscalationApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationApprover, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationApprover = (System.Collections.Generic.List) content.GetValueForProperty("EscalationApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationApprover, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSetTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApprovalStage(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApprovalStage(content); } @@ -169,12 +175,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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 approval stage. [System.ComponentModel.TypeConverter(typeof(ApprovalStageTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.TypeConverter.cs index c012b84cf350..8a3ccab84730 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.cs similarity index 79% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.cs index a05cf6b8ddcf..edb50e7cf99c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The approval stage. public partial class ApprovalStage : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] _escalationApprover; + private System.Collections.Generic.List _escalationApprover; /// The escalation approver of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] EscalationApprover { get => this._escalationApprover; set => this._escalationApprover = value; } + public System.Collections.Generic.List EscalationApprover { get => this._escalationApprover; set => this._escalationApprover = value; } /// Backing field for property. private int? _escalationTimeInMinute; @@ -44,11 +44,11 @@ public partial class ApprovalStage : public bool? IsEscalationEnabled { get => this._isEscalationEnabled; set => this._isEscalationEnabled = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] _primaryApprover; + private System.Collections.Generic.List _primaryApprover; /// The primary approver of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] PrimaryApprover { get => this._primaryApprover; set => this._primaryApprover = value; } + public System.Collections.Generic.List PrimaryApprover { get => this._primaryApprover; set => this._primaryApprover = value; } /// Backing field for property. private int? _timeOutInDay; @@ -71,16 +71,22 @@ public partial interface IApprovalStage : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The escalation approver of the request.", SerializedName = @"escalationApprovers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] EscalationApprover { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet) })] + System.Collections.Generic.List EscalationApprover { get; set; } /// /// The time in minutes when the approval request would be escalated if the primary approver does not approves. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time in minutes when the approval request would be escalated if the primary approver does not approves.", SerializedName = @"escalationTimeInMinutes", PossibleTypes = new [] { typeof(int) })] @@ -89,6 +95,9 @@ public partial interface IApprovalStage : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approver need to provide justification for his decision.", SerializedName = @"isApproverJustificationRequired", PossibleTypes = new [] { typeof(bool) })] @@ -97,6 +106,9 @@ public partial interface IApprovalStage : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value determine whether escalation feature is enabled.", SerializedName = @"isEscalationEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -105,14 +117,20 @@ public partial interface IApprovalStage : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The primary approver of the request.", SerializedName = @"primaryApprovers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] PrimaryApprover { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet) })] + System.Collections.Generic.List PrimaryApprover { get; set; } /// The time in days when approval request would be timed out. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time in days when approval request would be timed out.", SerializedName = @"approvalStageTimeOutInDays", PossibleTypes = new [] { typeof(int) })] @@ -124,7 +142,7 @@ internal partial interface IApprovalStageInternal { /// The escalation approver of the request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] EscalationApprover { get; set; } + System.Collections.Generic.List EscalationApprover { get; set; } /// /// The time in minutes when the approval request would be escalated if the primary approver does not approves. /// @@ -134,7 +152,7 @@ internal partial interface IApprovalStageInternal /// The value determine whether escalation feature is enabled. bool? IsEscalationEnabled { get; set; } /// The primary approver of the request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] PrimaryApprover { get; set; } + System.Collections.Generic.List PrimaryApprover { get; set; } /// The time in days when approval request would be timed out. int? TimeOutInDay { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.json.cs similarity index 87% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.json.cs index faf6e6aa356a..7f1eb704fe49 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,23 +65,23 @@ internal ApprovalStage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorizatio { return; } - {_timeOutInDay = If( json?.PropertyT("approvalStageTimeOutInDays"), out var __jsonApprovalStageTimeOutInDays) ? (int?)__jsonApprovalStageTimeOutInDays : TimeOutInDay;} - {_isApproverJustificationRequired = If( json?.PropertyT("isApproverJustificationRequired"), out var __jsonIsApproverJustificationRequired) ? (bool?)__jsonIsApproverJustificationRequired : IsApproverJustificationRequired;} - {_escalationTimeInMinute = If( json?.PropertyT("escalationTimeInMinutes"), out var __jsonEscalationTimeInMinutes) ? (int?)__jsonEscalationTimeInMinutes : EscalationTimeInMinute;} - {_primaryApprover = If( json?.PropertyT("primaryApprovers"), out var __jsonPrimaryApprovers) ? If( __jsonPrimaryApprovers as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IUserSet) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSet.FromJson(__u) )) ))() : null : PrimaryApprover;} - {_isEscalationEnabled = If( json?.PropertyT("isEscalationEnabled"), out var __jsonIsEscalationEnabled) ? (bool?)__jsonIsEscalationEnabled : IsEscalationEnabled;} - {_escalationApprover = If( json?.PropertyT("escalationApprovers"), out var __jsonEscalationApprovers) ? If( __jsonEscalationApprovers as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSet.FromJson(__p) )) ))() : null : EscalationApprover;} + {_timeOutInDay = If( json?.PropertyT("approvalStageTimeOutInDays"), out var __jsonApprovalStageTimeOutInDays) ? (int?)__jsonApprovalStageTimeOutInDays : _timeOutInDay;} + {_isApproverJustificationRequired = If( json?.PropertyT("isApproverJustificationRequired"), out var __jsonIsApproverJustificationRequired) ? (bool?)__jsonIsApproverJustificationRequired : _isApproverJustificationRequired;} + {_escalationTimeInMinute = If( json?.PropertyT("escalationTimeInMinutes"), out var __jsonEscalationTimeInMinutes) ? (int?)__jsonEscalationTimeInMinutes : _escalationTimeInMinute;} + {_primaryApprover = If( json?.PropertyT("primaryApprovers"), out var __jsonPrimaryApprovers) ? If( __jsonPrimaryApprovers as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSet.FromJson(__u) )) ))() : null : _primaryApprover;} + {_isEscalationEnabled = If( json?.PropertyT("isEscalationEnabled"), out var __jsonIsEscalationEnabled) ? (bool?)__jsonIsEscalationEnabled : _isEscalationEnabled;} + {_escalationApprover = If( json?.PropertyT("escalationApprovers"), out var __jsonEscalationApprovers) ? If( __jsonEscalationApprovers as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSet.FromJson(__p) )) ))() : null : _escalationApprover;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ApprovalStage(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.PowerShell.cs index 1d564e3c9330..6b2dcf94a13e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class AuthorizationIdentity 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 . @@ -204,6 +212,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(AuthorizationIdentityTypeConverter))] public partial interface IAuthorizationIdentity diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.cs index 1b33b35103c3..63cb3ab9a85a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.cs @@ -97,6 +97,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +108,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (hash of schedule name + time) of the role assignment schedule to get.", SerializedName = @"roleAssignmentScheduleInstanceName", PossibleTypes = new [] { typeof(string) })] @@ -113,6 +119,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (guid) of the role assignment schedule to get.", SerializedName = @"roleAssignmentScheduleName", PossibleTypes = new [] { typeof(string) })] @@ -121,6 +130,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the role assignment to create. It can be any valid GUID.", SerializedName = @"roleAssignmentScheduleRequestName", PossibleTypes = new [] { typeof(string) })] @@ -131,6 +143,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (hash of schedule name + time) of the role eligibility schedule to get.", SerializedName = @"roleEligibilityScheduleInstanceName", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +154,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (guid) of the role eligibility schedule to get.", SerializedName = @"roleEligibilityScheduleName", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +165,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the role eligibility to create. It can be any valid GUID.", SerializedName = @"roleEligibilityScheduleRequestName", PossibleTypes = new [] { typeof(string) })] @@ -155,6 +176,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of format {guid_guid} the role management policy assignment to get.", SerializedName = @"roleManagementPolicyAssignmentName", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +187,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (guid) of the role management policy to get.", SerializedName = @"roleManagementPolicyName", PossibleTypes = new [] { typeof(string) })] @@ -171,6 +198,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The scope of the role management policy.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.json.cs index 934d539f0f3f..a5e396088a9f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.json.cs @@ -64,16 +64,16 @@ internal AuthorizationIdentity(Microsoft.Azure.PowerShell.Cmdlets.Resources.Auth { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleAssignmentScheduleName = If( json?.PropertyT("roleAssignmentScheduleName"), out var __jsonRoleAssignmentScheduleName) ? (string)__jsonRoleAssignmentScheduleName : (string)RoleAssignmentScheduleName;} - {_roleAssignmentScheduleInstanceName = If( json?.PropertyT("roleAssignmentScheduleInstanceName"), out var __jsonRoleAssignmentScheduleInstanceName) ? (string)__jsonRoleAssignmentScheduleInstanceName : (string)RoleAssignmentScheduleInstanceName;} - {_roleAssignmentScheduleRequestName = If( json?.PropertyT("roleAssignmentScheduleRequestName"), out var __jsonRoleAssignmentScheduleRequestName) ? (string)__jsonRoleAssignmentScheduleRequestName : (string)RoleAssignmentScheduleRequestName;} - {_roleEligibilityScheduleName = If( json?.PropertyT("roleEligibilityScheduleName"), out var __jsonRoleEligibilityScheduleName) ? (string)__jsonRoleEligibilityScheduleName : (string)RoleEligibilityScheduleName;} - {_roleEligibilityScheduleInstanceName = If( json?.PropertyT("roleEligibilityScheduleInstanceName"), out var __jsonRoleEligibilityScheduleInstanceName) ? (string)__jsonRoleEligibilityScheduleInstanceName : (string)RoleEligibilityScheduleInstanceName;} - {_roleEligibilityScheduleRequestName = If( json?.PropertyT("roleEligibilityScheduleRequestName"), out var __jsonRoleEligibilityScheduleRequestName) ? (string)__jsonRoleEligibilityScheduleRequestName : (string)RoleEligibilityScheduleRequestName;} - {_roleManagementPolicyName = If( json?.PropertyT("roleManagementPolicyName"), out var __jsonRoleManagementPolicyName) ? (string)__jsonRoleManagementPolicyName : (string)RoleManagementPolicyName;} - {_roleManagementPolicyAssignmentName = If( json?.PropertyT("roleManagementPolicyAssignmentName"), out var __jsonRoleManagementPolicyAssignmentName) ? (string)__jsonRoleManagementPolicyAssignmentName : (string)RoleManagementPolicyAssignmentName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleAssignmentScheduleName = If( json?.PropertyT("roleAssignmentScheduleName"), out var __jsonRoleAssignmentScheduleName) ? (string)__jsonRoleAssignmentScheduleName : (string)_roleAssignmentScheduleName;} + {_roleAssignmentScheduleInstanceName = If( json?.PropertyT("roleAssignmentScheduleInstanceName"), out var __jsonRoleAssignmentScheduleInstanceName) ? (string)__jsonRoleAssignmentScheduleInstanceName : (string)_roleAssignmentScheduleInstanceName;} + {_roleAssignmentScheduleRequestName = If( json?.PropertyT("roleAssignmentScheduleRequestName"), out var __jsonRoleAssignmentScheduleRequestName) ? (string)__jsonRoleAssignmentScheduleRequestName : (string)_roleAssignmentScheduleRequestName;} + {_roleEligibilityScheduleName = If( json?.PropertyT("roleEligibilityScheduleName"), out var __jsonRoleEligibilityScheduleName) ? (string)__jsonRoleEligibilityScheduleName : (string)_roleEligibilityScheduleName;} + {_roleEligibilityScheduleInstanceName = If( json?.PropertyT("roleEligibilityScheduleInstanceName"), out var __jsonRoleEligibilityScheduleInstanceName) ? (string)__jsonRoleEligibilityScheduleInstanceName : (string)_roleEligibilityScheduleInstanceName;} + {_roleEligibilityScheduleRequestName = If( json?.PropertyT("roleEligibilityScheduleRequestName"), out var __jsonRoleEligibilityScheduleRequestName) ? (string)__jsonRoleEligibilityScheduleRequestName : (string)_roleEligibilityScheduleRequestName;} + {_roleManagementPolicyName = If( json?.PropertyT("roleManagementPolicyName"), out var __jsonRoleManagementPolicyName) ? (string)__jsonRoleManagementPolicyName : (string)_roleManagementPolicyName;} + {_roleManagementPolicyAssignmentName = If( json?.PropertyT("roleManagementPolicyAssignmentName"), out var __jsonRoleManagementPolicyAssignmentName) ? (string)__jsonRoleManagementPolicyAssignmentName : (string)_roleManagementPolicyAssignmentName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.PowerShell.cs index 5c83571f6911..2f79b4cd67fe 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class CloudError partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of 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. @@ -70,21 +78,21 @@ internal CloudError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,43 +107,41 @@ internal CloudError(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CloudError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CloudError(content); } @@ -145,12 +151,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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 error response from the service. [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.TypeConverter.cs index ed48d57ed3f1..c4a507b5f9b0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.cs index 0ca962b5c731..7af0b438872c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.cs @@ -3,37 +3,37 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// An error response from the service. public partial class CloudError : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal { /// /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)Error).Code = value ?? null; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)Error).Code = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody _error; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody _error; /// An error response from the service. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody()); set => this._error = value; } /// /// A message describing the error, intended to be suitable for display in a user interface. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)Error).Message = value ?? null; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)Error).Message = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody()); set { {_error = value;} } } /// Creates an new instance. public CloudError() @@ -51,6 +51,9 @@ public partial interface ICloudError : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface ICloudError : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message describing the error, intended to be suitable for display in a user interface.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -76,7 +82,7 @@ internal partial interface ICloudErrorInternal /// string Code { get; set; } /// An error response from the service. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody Error { get; set; } /// /// A message describing the error, intended to be suitable for display in a user interface. /// diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.json.cs index 6bd2e9e7a466..c609b675f324 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,18 +65,18 @@ internal CloudError(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.R { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new CloudError(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.PowerShell.cs similarity index 73% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.PowerShell.cs index 4f10895a14a6..17b617984fdf 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class CloudErrorBody partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of 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. @@ -70,17 +78,17 @@ internal CloudErrorBody(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -95,39 +103,37 @@ internal CloudErrorBody(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CloudErrorBody(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CloudErrorBody(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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 error response from the service. [System.ComponentModel.TypeConverter(typeof(CloudErrorBodyTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.TypeConverter.cs index 7362ee3d9e1d..2b275e05a7d9 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.cs index 56ff5264d1d1..b1ec3175db29 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// An error response from the service. public partial class CloudErrorBody : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal { /// Backing field for property. @@ -47,6 +47,9 @@ public partial interface ICloudErrorBody : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -57,6 +60,9 @@ public partial interface ICloudErrorBody : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message describing the error, intended to be suitable for display in a user interface.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.json.cs similarity index 95% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.json.cs index 55d5bb4c7e89..ac997a9dbfb7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,19 +65,19 @@ internal CloudErrorBody(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorizati { 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;} + {_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.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new CloudErrorBody(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.PowerShell.cs index 0644589258dc..91bcddd7066b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class EligibleChildResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EligibleChildResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EligibleChildResource(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,21 +104,21 @@ internal EligibleChildResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -127,15 +133,15 @@ internal EligibleChildResource(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,12 +151,24 @@ internal EligibleChildResource(global::System.Management.Automation.PSObject con /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Eligible child resource [System.ComponentModel.TypeConverter(typeof(EligibleChildResourceTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.TypeConverter.cs index b3bae7099f15..03580cb31ded 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.cs similarity index 87% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.cs index 980ec40ccffa..a7856f185330 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Eligible child resource public partial class EligibleChildResource : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal { /// Backing field for property. @@ -22,13 +22,13 @@ public partial class EligibleChildResource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -60,6 +60,9 @@ public partial interface IEligibleChildResource : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource scope Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -68,6 +71,9 @@ public partial interface IEligibleChildResource : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +82,9 @@ public partial interface IEligibleChildResource : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.json.cs index 6d996ad89523..c759484c5595 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,20 +65,20 @@ internal EligibleChildResource(Microsoft.Azure.PowerShell.Cmdlets.Resources.Auth { 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;} + {_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); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new EligibleChildResource(json) : null; } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.PowerShell.cs index 550fd28cefd8..4732ebc37b24 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class EligibleChildResourcesListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EligibleChildResourcesListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EligibleChildResourcesListResult(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,17 +106,17 @@ internal EligibleChildResourcesListResult(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -123,11 +131,11 @@ internal EligibleChildResourcesListResult(global::System.Management.Automation.P // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -137,12 +145,24 @@ internal EligibleChildResourcesListResult(global::System.Management.Automation.P /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Eligible child resources list operation result. [System.ComponentModel.TypeConverter(typeof(EligibleChildResourcesListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.TypeConverter.cs index 7fa0976ba621..0e658f66f64c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.cs index 2286d794b9ab..db03a16e787a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Eligible child resources list operation result. public partial class EligibleChildResourcesListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class EligibleChildResourcesListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[] _value; + private System.Collections.Generic.List _value; /// Eligible child resource list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public EligibleChildResourcesListResult() @@ -41,6 +41,9 @@ public partial interface IEligibleChildResourcesListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IEligibleChildResourcesListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Eligible child resource list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource) })] + System.Collections.Generic.List Value { get; set; } } /// Eligible child resources list operation result. @@ -62,7 +68,7 @@ internal partial interface IEligibleChildResourcesListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Eligible child resource list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.json.cs index 88e7732e2ddb..b4831ca1239e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,19 +65,19 @@ internal EligibleChildResourcesListResult(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResource.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResource.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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new EligibleChildResourcesListResult(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.PowerShell.cs new file mode 100644 index 000000000000..87c5099088b4 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.PowerShell.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesTypeConverter))] + public partial class ExpandedProperties + { + + /// + /// 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.Resources.Authorization.Models.IExpandedProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExpandedProperties(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.Resources.Authorization.Models.IExpandedProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExpandedProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExpandedProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("RoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Principal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Principal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("Principal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Principal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalType, 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 ExpandedProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("RoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Principal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Principal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("Principal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Principal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalType, 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.Resources.Authorization.Models.IExpandedProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(ExpandedPropertiesTypeConverter))] + public partial interface IExpandedProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.TypeConverter.cs index e99ba506ed37..5358450856fe 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.cs index 506f925f13fd..725fbb2f7c2f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.cs @@ -3,84 +3,84 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; public partial class ExpandedProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal { /// Internal Acessors for Principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal.Principal { get => (this._principal = this._principal ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal()); set { {_principal = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal.Principal { get => (this._principal = this._principal ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal()); set { {_principal = value;} } } /// Internal Acessors for RoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal.RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition()); set { {_roleDefinition = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal.RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition()); set { {_roleDefinition = value;} } } /// Internal Acessors for Scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope()); set { {_scope = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope()); set { {_scope = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal _principal; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal _principal; /// Details of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Principal { get => (this._principal = this._principal ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal()); set => this._principal = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Principal { get => (this._principal = this._principal ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal()); set => this._principal = value; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).DisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).DisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Email = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Email = value ?? null; } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Id = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Id = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Type = value ?? null; } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Type = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition _roleDefinition; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition _roleDefinition; /// Details of role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition()); set => this._roleDefinition = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition()); set => this._roleDefinition = value; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Id = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Id = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Type = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Type = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope _scope; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope _scope; /// Details of the resource scope [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope()); set => this._scope = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope()); set => this._scope = value; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).DisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).DisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).Id = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).Id = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).Type = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).Type = value ?? null; } /// Creates an new instance. public ExpandedProperties() @@ -95,6 +95,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -103,6 +106,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -111,6 +117,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -119,6 +128,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +139,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +150,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -143,6 +161,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -151,6 +172,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -159,6 +183,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -167,6 +194,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -177,7 +207,7 @@ internal partial interface IExpandedPropertiesInternal { /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Principal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Principal { get; set; } /// Display name of the principal string PrincipalDisplayName { get; set; } /// Email id of the principal @@ -187,7 +217,7 @@ internal partial interface IExpandedPropertiesInternal /// Type of the principal string PrincipalType { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition RoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition RoleDefinition { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// Id of the role definition @@ -195,7 +225,7 @@ internal partial interface IExpandedPropertiesInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Scope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Scope { get; set; } /// Display name of the resource string ScopeDisplayName { get; set; } /// Scope id of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.json.cs similarity index 91% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.json.cs index 6d7600b20205..43f48ed2edd7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -64,20 +64,20 @@ internal ExpandedProperties(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authori { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope.FromJson(__jsonScope) : Scope;} - {_roleDefinition = If( json?.PropertyT("roleDefinition"), out var __jsonRoleDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition.FromJson(__jsonRoleDefinition) : RoleDefinition;} - {_principal = If( json?.PropertyT("principal"), out var __jsonPrincipal) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal.FromJson(__jsonPrincipal) : Principal;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope.FromJson(__jsonScope) : _scope;} + {_roleDefinition = If( json?.PropertyT("roleDefinition"), out var __jsonRoleDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition.FromJson(__jsonRoleDefinition) : _roleDefinition;} + {_principal = If( json?.PropertyT("principal"), out var __jsonPrincipal) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal.FromJson(__jsonPrincipal) : _principal;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ExpandedProperties(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.PowerShell.cs index ad4e24cff6fa..2a18664a846e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class ExpandedPropertiesPrincipal partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExpandedPropertiesPrincipal(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExpandedPropertiesPrincipal(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,25 +106,25 @@ internal ExpandedPropertiesPrincipal(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Email, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,19 +139,19 @@ internal ExpandedPropertiesPrincipal(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Email, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -153,12 +161,24 @@ internal ExpandedPropertiesPrincipal(global::System.Management.Automation.PSObje /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Details of the principal [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesPrincipalTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.TypeConverter.cs index 8f0ca1e74b0b..932056a302c6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.cs index 9c9d4a8f9c4b..ed8464af812c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the principal public partial class ExpandedPropertiesPrincipal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IExpandedPropertiesPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IExpandedPropertiesPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IExpandedPropertiesPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IExpandedPropertiesPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.json.cs index dbf52fe471f1..9800a208e1ac 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ExpandedPropertiesPrincipal(Microsoft.Azure.PowerShell.Cmdlets.Resource { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)_email;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ExpandedPropertiesPrincipal(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.PowerShell.cs index 8aa6591b85b4..2bb63fbed21a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class ExpandedPropertiesRoleDefinition partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExpandedPropertiesRoleDefinition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExpandedPropertiesRoleDefinition(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,21 +106,21 @@ internal ExpandedPropertiesRoleDefinition(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -127,15 +135,15 @@ internal ExpandedPropertiesRoleDefinition(global::System.Management.Automation.P // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,12 +153,24 @@ internal ExpandedPropertiesRoleDefinition(global::System.Management.Automation.P /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Details of role definition [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesRoleDefinitionTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.TypeConverter.cs index 22df5c0f2a39..b80ddc075f3d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.cs index e60dadd00955..6e800ccc8cc2 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of role definition public partial class ExpandedPropertiesRoleDefinition : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IExpandedPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IExpandedPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IExpandedPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.json.cs index 053de8935958..ba29a73ea74f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ExpandedPropertiesRoleDefinition(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ExpandedPropertiesRoleDefinition(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.PowerShell.cs index efa9a0753016..e870efbfa7a0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class ExpandedPropertiesScope partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExpandedPropertiesScope(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExpandedPropertiesScope(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,21 +106,21 @@ internal ExpandedPropertiesScope(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -127,15 +135,15 @@ internal ExpandedPropertiesScope(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,12 +153,24 @@ internal ExpandedPropertiesScope(global::System.Management.Automation.PSObject c /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Details of the resource scope [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesScopeTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.TypeConverter.cs index bb3819c00d13..918c919a5bcd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.cs index 027ffd2e29e5..cf3c51b0d8cb 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the resource scope public partial class ExpandedPropertiesScope : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IExpandedPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IExpandedPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IExpandedPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.json.cs index caeafe4af84a..d1c5c0d70e86 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ExpandedPropertiesScope(Microsoft.Azure.PowerShell.Cmdlets.Resources.Au { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ExpandedPropertiesScope(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.PowerShell.cs new file mode 100644 index 000000000000..380be2019867 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.PowerShell.cs @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesTypeConverter))] + public partial class PolicyAssignmentProperties + { + + /// + /// 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.Resources.Authorization.Models.IPolicyAssignmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PolicyAssignmentProperties(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.Resources.Authorization.Models.IPolicyAssignmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PolicyAssignmentProperties(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.Resources.Authorization.Models.IPolicyAssignmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PolicyAssignmentProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("RoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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 PolicyAssignmentProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("RoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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.Resources.Authorization.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(PolicyAssignmentPropertiesTypeConverter))] + public partial interface IPolicyAssignmentProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.TypeConverter.cs index 1e48063c3468..12605c64252e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.cs index 2a332473a8dc..1069aac54962 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.cs @@ -3,95 +3,107 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; public partial class PolicyAssignmentProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal { /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType; } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType = value ?? null; } /// Internal Acessors for Policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy()); set { {_policy = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy()); set { {_policy = value;} } } /// Internal Acessors for PolicyLastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedBy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedBy = value ?? null /* model class */; } /// Internal Acessors for RoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal.RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition()); set { {_roleDefinition = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition()); set { {_roleDefinition = value;} } } /// Internal Acessors for Scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope()); set { {_scope = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope()); set { {_scope = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy _policy; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy _policy; /// Details of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy()); set => this._policy = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy()); set => this._policy = value; } /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).Id = value ?? null; } + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).Id = value ?? null; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedDateTime = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition _roleDefinition; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition _roleDefinition; /// Details of role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition()); set => this._roleDefinition = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition()); set => this._roleDefinition = value; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Id = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Id = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Type = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Type = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope _scope; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope _scope; /// Details of the resource scope [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope()); set => this._scope = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope()); set => this._scope = value; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).DisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).DisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).Id = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).Id = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).Type = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).Type = value ?? null; } /// Creates an new instance. public PolicyAssignmentProperties() @@ -105,39 +117,54 @@ public partial interface IPolicyAssignmentProperties : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the policy", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -146,6 +173,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -154,6 +184,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -162,6 +195,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -170,6 +206,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -178,6 +217,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -186,6 +228,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +239,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -212,15 +260,15 @@ internal partial interface IPolicyAssignmentPropertiesInternal /// Type of principal such as user , group etc string LastModifiedByType { get; set; } /// Details of the policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Policy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Policy { get; set; } /// Id of the policy string PolicyId { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal PolicyLastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal PolicyLastModifiedBy { get; set; } /// The last modified date time. global::System.DateTime? PolicyLastModifiedDateTime { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition RoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition RoleDefinition { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// Id of the role definition @@ -228,7 +276,7 @@ internal partial interface IPolicyAssignmentPropertiesInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Scope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Scope { get; set; } /// Display name of the resource string ScopeDisplayName { get; set; } /// Scope id of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.json.cs similarity index 91% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.json.cs index 048363383df7..53fb48f2fd2e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -53,13 +53,13 @@ public partial class PolicyAssignmentProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyAssignmentProperties(json) : null; } @@ -76,9 +76,9 @@ internal PolicyAssignmentProperties(Microsoft.Azure.PowerShell.Cmdlets.Resources { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope.FromJson(__jsonScope) : Scope;} - {_roleDefinition = If( json?.PropertyT("roleDefinition"), out var __jsonRoleDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition.FromJson(__jsonRoleDefinition) : RoleDefinition;} - {_policy = If( json?.PropertyT("policy"), out var __jsonPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy.FromJson(__jsonPolicy) : Policy;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope.FromJson(__jsonScope) : _scope;} + {_roleDefinition = If( json?.PropertyT("roleDefinition"), out var __jsonRoleDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition.FromJson(__jsonRoleDefinition) : _roleDefinition;} + {_policy = If( json?.PropertyT("policy"), out var __jsonPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy.FromJson(__jsonPolicy) : _policy;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.PowerShell.cs similarity index 57% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.PowerShell.cs index db9339daac4d..ab754300370d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class PolicyAssignmentPropertiesPolicy partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyAssignmentPropertiesPolicy(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyAssignmentPropertiesPolicy(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,37 +113,37 @@ internal PolicyAssignmentPropertiesPolicy(global::System.Collections.IDictionary // actually deserialize if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("LastModifiedDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedById")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); } if (content.Contains("LastModifiedByDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedByEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -150,31 +158,31 @@ internal PolicyAssignmentPropertiesPolicy(global::System.Management.Automation.P // actually deserialize if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("LastModifiedDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedById")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); } if (content.Contains("LastModifiedByDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedByEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -183,6 +191,18 @@ internal PolicyAssignmentPropertiesPolicy(global::System.Management.Automation.P /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Details of the policy [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesPolicyTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.TypeConverter.cs index bac5f260262a..5cea4a76f218 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.cs index 44a953874015..207600fb72ac 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the policy public partial class PolicyAssignmentPropertiesPolicy : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal { /// Backing field for property. @@ -21,27 +21,27 @@ public partial class PolicyAssignmentPropertiesPolicy : public string Id { get => this._id; set => this._id = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal _lastModifiedBy; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal _lastModifiedBy; /// The name of the entity last modified it [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal()); } /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).DisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Email = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Id = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Type = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type; } /// Backing field for property. private global::System.DateTime? _lastModifiedDateTime; @@ -51,7 +51,19 @@ public partial class PolicyAssignmentPropertiesPolicy : public global::System.DateTime? LastModifiedDateTime { get => this._lastModifiedDateTime; set => this._lastModifiedDateTime = value; } /// Internal Acessors for LastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal()); set { {_lastModifiedBy = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal()); set { {_lastModifiedBy = value;} } } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type = value ?? null; } /// Creates an new instance. public PolicyAssignmentPropertiesPolicy() @@ -67,6 +79,9 @@ public partial interface IPolicyAssignmentPropertiesPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the policy", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -74,39 +89,54 @@ public partial interface IPolicyAssignmentPropertiesPolicy : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -120,7 +150,7 @@ internal partial interface IPolicyAssignmentPropertiesPolicyInternal /// Id of the policy string Id { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get; set; } /// The name of the principal made changes string LastModifiedByDisplayName { get; set; } /// Email of principal diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.json.cs index 9f120560b524..83d5233efafc 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PolicyAssignmentPropertiesPolicy partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyAssignmentPropertiesPolicy(json) : null; } @@ -77,9 +77,9 @@ internal PolicyAssignmentPropertiesPolicy(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal.FromJson(__jsonLastModifiedBy) : LastModifiedBy;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_lastModifiedDateTime = If( json?.PropertyT("lastModifiedDateTime"), out var __jsonLastModifiedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedDateTimeValue) ? __jsonLastModifiedDateTimeValue : LastModifiedDateTime : LastModifiedDateTime;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal.FromJson(__jsonLastModifiedBy) : _lastModifiedBy;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_lastModifiedDateTime = If( json?.PropertyT("lastModifiedDateTime"), out var __jsonLastModifiedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedDateTimeValue) ? __jsonLastModifiedDateTimeValue : _lastModifiedDateTime : _lastModifiedDateTime;} AfterFromJson(json); } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastModifiedBy ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._lastModifiedBy.ToJson(null,serializationMode) : null, "lastModifiedBy" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs similarity index 68% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs index 04498caf3b0a..b9b447919d50 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class PolicyAssignmentPropertiesRoleDefinition partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyAssignmentPropertiesRoleDefinition(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyAssignmentPropertiesRoleDefinition(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,21 +116,21 @@ internal PolicyAssignmentPropertiesRoleDefinition(global::System.Collections.IDi // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,15 +145,15 @@ internal PolicyAssignmentPropertiesRoleDefinition(global::System.Management.Auto // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,6 +162,18 @@ internal PolicyAssignmentPropertiesRoleDefinition(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Details of role definition [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesRoleDefinitionTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs index a62143b528ba..ca19f968c18c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.cs index a6f7625ac548..e89c85488975 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of role definition public partial class PolicyAssignmentPropertiesRoleDefinition : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal { /// Backing field for property. @@ -50,6 +50,9 @@ public partial interface IPolicyAssignmentPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -58,6 +61,9 @@ public partial interface IPolicyAssignmentPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +72,9 @@ public partial interface IPolicyAssignmentPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.json.cs index ab7ded7aefce..d3508f8c867c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PolicyAssignmentPropertiesRoleDefinition partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyAssignmentPropertiesRoleDefinition(json) : null; } @@ -77,9 +77,9 @@ internal PolicyAssignmentPropertiesRoleDefinition(Microsoft.Azure.PowerShell.Cmd { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.PowerShell.cs index e0fbd1ddf98b..807c1bbfcbed 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class PolicyAssignmentPropertiesScope partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyAssignmentPropertiesScope(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyAssignmentPropertiesScope(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +113,21 @@ internal PolicyAssignmentPropertiesScope(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +142,15 @@ internal PolicyAssignmentPropertiesScope(global::System.Management.Automation.PS // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal PolicyAssignmentPropertiesScope(global::System.Management.Automation.PS /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Details of the resource scope [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesScopeTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.TypeConverter.cs index 88966b72c997..b933ec81d6b0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.cs index 0ec0b95ece97..bbb37d6bfe07 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the resource scope public partial class PolicyAssignmentPropertiesScope : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IPolicyAssignmentPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IPolicyAssignmentPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IPolicyAssignmentPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.json.cs index 7c04ab24df06..4c432b764dea 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PolicyAssignmentPropertiesScope partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyAssignmentPropertiesScope(json) : null; } @@ -77,9 +77,9 @@ internal PolicyAssignmentPropertiesScope(Microsoft.Azure.PowerShell.Cmdlets.Reso { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.PowerShell.cs index 148f8b97d53e..dd531509d25b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -54,29 +54,35 @@ public partial class PolicyProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyProperties(content); } @@ -86,10 +92,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,25 +110,25 @@ internal PolicyProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); } if (content.Contains("ScopeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); } if (content.Contains("ScopeDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); } if (content.Contains("ScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,19 +143,19 @@ internal PolicyProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); } if (content.Contains("ScopeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); } if (content.Contains("ScopeDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); } if (content.Contains("ScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -158,6 +164,18 @@ internal PolicyProperties(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(PolicyPropertiesTypeConverter))] public partial interface IPolicyProperties diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.TypeConverter.cs index 1516c7aad252..760bf1f983d0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.cs index 8c5646aa7878..b630a4498300 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.cs @@ -3,36 +3,45 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; public partial class PolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal { /// Internal Acessors for Scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope()); set { {_scope = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope()); set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).DisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Id = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Type = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope _scope; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope _scope; /// Details of the resource scope [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope()); } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).DisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).DisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).Id = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Id; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).Type = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Type; } /// Creates an new instance. public PolicyProperties() @@ -46,34 +55,43 @@ public partial interface IPolicyProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } } internal partial interface IPolicyPropertiesInternal { /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Scope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Scope { get; set; } /// Display name of the resource string ScopeDisplayName { get; set; } /// Scope id of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.json.cs index 3754981320c9..f279d2cbfca8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -53,13 +53,13 @@ public partial class PolicyProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyProperties(json) : null; } @@ -76,7 +76,7 @@ internal PolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authoriza { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope.FromJson(__jsonScope) : Scope;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope.FromJson(__jsonScope) : _scope;} AfterFromJson(json); } @@ -99,7 +99,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._scope ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._scope.ToJson(null,serializationMode) : null, "scope" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.PowerShell.cs index 9cc271c8d846..4760d7ed06e7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PolicyPropertiesScope partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyPropertiesScope(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyPropertiesScope(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +111,21 @@ internal PolicyPropertiesScope(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +140,15 @@ internal PolicyPropertiesScope(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal PolicyPropertiesScope(global::System.Management.Automation.PSObject con /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Details of the resource scope [System.ComponentModel.TypeConverter(typeof(PolicyPropertiesScopeTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.TypeConverter.cs index 8d7b6032ee4b..7b1c73733e60 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.cs index e6af8744bee7..b1f35f7b55ba 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the resource scope public partial class PolicyPropertiesScope : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IPolicyPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IPolicyPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IPolicyPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.json.cs index 10c3f5bf289b..4195e894566e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PolicyPropertiesScope partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyPropertiesScope(json) : null; } @@ -77,9 +77,9 @@ internal PolicyPropertiesScope(Microsoft.Azure.PowerShell.Cmdlets.Resources.Auth { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/Principal.PowerShell.cs index efa556d15663..219e93fee96d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class Principal partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Principal(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Principal(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,25 +111,25 @@ internal Principal(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Email, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,19 +144,19 @@ internal Principal(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Email, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -159,6 +165,18 @@ internal Principal(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 name of the entity last modified it [System.ComponentModel.TypeConverter(typeof(PrincipalTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/Principal.TypeConverter.cs index 60e6e4912efa..a4715e8161a8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/Principal.cs index c3712f8b0778..00f082f1491a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The name of the entity last modified it public partial class Principal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/Principal.json.cs index c62e9521bc45..e623ab49100a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Principal partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new Principal(json) : null; } @@ -77,10 +77,10 @@ internal Principal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Ru { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)_email;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.PowerShell.cs new file mode 100644 index 000000000000..1996aa971f7f --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role Assignment schedule + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleTypeConverter))] + public partial class RoleAssignmentSchedule + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentSchedule(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.Resources.Authorization.Models.IRoleAssignmentSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentSchedule(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.Resources.Authorization.Models.IRoleAssignmentSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentSchedule(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.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RequestId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentSchedule(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.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RequestId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role Assignment schedule + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleTypeConverter))] + public partial interface IRoleAssignmentSchedule + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.TypeConverter.cs index 7a6be58d560f..308ef69daa3d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.cs index 47083012c973..6e2a85666eff 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.cs @@ -3,20 +3,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role Assignment schedule public partial class RoleAssignmentSchedule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal { /// Assignment type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).AssignmentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).AssignmentType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType)""); } + public string AssignmentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).AssignmentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).AssignmentType = value ?? null; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] @@ -24,37 +24,37 @@ public partial class RoleAssignmentSchedule : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role assignment schedule was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } /// End DateTime when role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Backing field for property. private string _id; @@ -67,36 +67,36 @@ public partial class RoleAssignmentSchedule : /// The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } + public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } /// Membership type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).MemberType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType)""); } + public string MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).MemberType = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -109,37 +109,37 @@ public partial class RoleAssignmentSchedule : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalEmail = value ?? null; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType)""); } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties _property; /// Role assignment schedule properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties()); set => this._property = value; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RequestId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleAssignmentScheduleRequestId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleAssignmentScheduleRequestId = value ?? null; } + public string RequestId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleAssignmentScheduleRequestId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleAssignmentScheduleRequestId = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -149,47 +149,47 @@ public partial class RoleAssignmentSchedule : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// The role assignment schedule scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Scope = value ?? null; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeType = value ?? null; } /// Start DateTime when role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } /// The status of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Status = value ?? null; } /// Backing field for property. private string _type; @@ -202,7 +202,7 @@ public partial class RoleAssignmentSchedule : /// DateTime when role assignment schedule was modified [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? UpdatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).UpdatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).UpdatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? UpdatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).UpdatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).UpdatedOn = value ?? default(global::System.DateTime); } /// Creates an new instance. public RoleAssignmentSchedule() @@ -218,10 +218,14 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Assignment type of the role assignment schedule", SerializedName = @"assignmentType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -229,6 +233,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -237,6 +244,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -245,6 +255,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -253,6 +266,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime when role assignment schedule", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -261,6 +277,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -269,6 +288,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -277,6 +299,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -285,6 +310,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -293,6 +321,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -301,14 +332,21 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role assignment schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role assignment schedule name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -317,6 +355,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -325,6 +366,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -333,6 +377,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -341,16 +388,23 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule", SerializedName = @"roleAssignmentScheduleRequestId", PossibleTypes = new [] { typeof(string) })] @@ -359,6 +413,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -367,6 +424,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -375,6 +435,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -383,6 +446,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -391,6 +457,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -399,6 +468,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -407,6 +479,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -415,6 +490,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime when role assignment schedule", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -423,14 +501,21 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role assignment schedule.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role assignment schedule type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -439,6 +524,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was modified", SerializedName = @"updatedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -450,7 +538,8 @@ internal partial interface IRoleAssignmentScheduleInternal { /// Assignment type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -469,19 +558,20 @@ internal partial interface IRoleAssignmentScheduleInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The role assignment schedule Id. string Id { get; set; } /// The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule string LinkedRoleEligibilityScheduleId { get; set; } /// Membership type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role assignment schedule name. string Name { get; set; } /// Display name of the principal @@ -491,9 +581,10 @@ internal partial interface IRoleAssignmentScheduleInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role assignment schedule properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties Property { get; set; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// @@ -515,7 +606,8 @@ internal partial interface IRoleAssignmentScheduleInternal /// Start DateTime when role assignment schedule global::System.DateTime? StartDateTime { get; set; } /// The status of the role assignment schedule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role assignment schedule type. string Type { get; set; } /// DateTime when role assignment schedule was modified diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.json.cs index 59b5e2f2bb45..8afd52da4d31 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentSchedule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentSchedule(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentSchedule(Microsoft.Azure.PowerShell.Cmdlets.Resources.Aut { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.PowerShell.cs index 4a61b02a3b9c..1b1427d1777b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleFilter(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleFilter(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +113,21 @@ internal RoleAssignmentScheduleFilter(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +142,15 @@ internal RoleAssignmentScheduleFilter(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal RoleAssignmentScheduleFilter(global::System.Management.Automation.PSObj /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule filter [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.TypeConverter.cs index 641a8b03e62c..16cfcc8b5568 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.cs index fd48fc589048..74326730d73c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule filter public partial class RoleAssignmentScheduleFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IRoleAssignmentScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IRoleAssignmentScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IRoleAssignmentScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances of the specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.json.cs index 5f86bd837e3e..e64276aa453b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleFilter(json) : null; } @@ -77,9 +77,9 @@ internal RoleAssignmentScheduleFilter(Microsoft.Azure.PowerShell.Cmdlets.Resourc { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.PowerShell.cs new file mode 100644 index 000000000000..2e3db697e938 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.PowerShell.cs @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Information about current or upcoming role assignment schedule instance + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceTypeConverter))] + public partial class RoleAssignmentScheduleInstance + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("OriginRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("OriginRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Information about current or upcoming role assignment schedule instance + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceTypeConverter))] + public partial interface IRoleAssignmentScheduleInstance + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.TypeConverter.cs index 7d036ecdec6d..5ebbe185790a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.cs index 94c47b24b700..0134fba36c6b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.cs @@ -3,20 +3,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Information about current or upcoming role assignment schedule instance public partial class RoleAssignmentScheduleInstance : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal { /// Assignment type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).AssignmentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).AssignmentType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType)""); } + public string AssignmentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).AssignmentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).AssignmentType = value ?? null; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] @@ -24,37 +24,37 @@ public partial class RoleAssignmentScheduleInstance : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role assignment schedule was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } /// The endDateTime of the role assignment schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Backing field for property. private string _id; @@ -67,41 +67,41 @@ public partial class RoleAssignmentScheduleInstance : /// roleEligibilityScheduleId used to activate [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } + public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } /// roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LinkedRoleEligibilityScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleInstanceId = value ?? null; } + public string LinkedRoleEligibilityScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleInstanceId = value ?? null; } /// Membership type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).MemberType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType)""); } + public string MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).MemberType = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -114,35 +114,35 @@ public partial class RoleAssignmentScheduleInstance : /// Role Assignment Id in external system [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string OriginRoleAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).OriginRoleAssignmentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).OriginRoleAssignmentId = value ?? null; } + public string OriginRoleAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).OriginRoleAssignmentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).OriginRoleAssignmentId = value ?? null; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalEmail = value ?? null; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType)""); } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties _property; /// Role assignment schedule instance properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -152,52 +152,52 @@ public partial class RoleAssignmentScheduleInstance : /// Id of the master role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleAssignmentScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleAssignmentScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleAssignmentScheduleId = value ?? null; } + public string RoleAssignmentScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleAssignmentScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleAssignmentScheduleId = value ?? null; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// The role assignment schedule scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Scope = value ?? null; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeType = value ?? null; } /// The startDateTime of the role assignment schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } /// The status of the role assignment schedule instance. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Status = value ?? null; } /// Backing field for property. private string _type; @@ -221,10 +221,14 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Assignment type of the role assignment schedule", SerializedName = @"assignmentType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -232,6 +236,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -240,6 +247,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -248,6 +258,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -256,6 +269,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endDateTime of the role assignment schedule instance", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -264,6 +280,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -272,6 +291,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -280,6 +302,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -288,6 +313,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule instance ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -296,6 +324,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"roleEligibilityScheduleId used to activate", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -304,6 +335,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance", SerializedName = @"linkedRoleEligibilityScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -312,14 +346,21 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role assignment schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role assignment schedule instance name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule instance name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -328,6 +369,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role Assignment Id in external system", SerializedName = @"originRoleAssignmentId", PossibleTypes = new [] { typeof(string) })] @@ -336,6 +380,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -344,6 +391,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -352,6 +402,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -360,14 +413,21 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Id of the master role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the master role assignment schedule", SerializedName = @"roleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -376,6 +436,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -384,6 +447,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -392,6 +458,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -400,6 +469,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -408,6 +480,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -416,6 +491,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -424,6 +502,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -432,6 +513,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The startDateTime of the role assignment schedule instance", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -440,14 +524,21 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role assignment schedule instance.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role assignment schedule instance type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule instance type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -459,7 +550,8 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal { /// Assignment type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -478,13 +570,13 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The role assignment schedule instance ID. string Id { get; set; } /// roleEligibilityScheduleId used to activate @@ -492,7 +584,8 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal /// roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance string LinkedRoleEligibilityScheduleInstanceId { get; set; } /// Membership type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role assignment schedule instance name. string Name { get; set; } /// Role Assignment Id in external system @@ -504,9 +597,10 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role assignment schedule instance properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties Property { get; set; } /// Id of the master role assignment schedule string RoleAssignmentScheduleId { get; set; } /// Display name of the role definition @@ -526,7 +620,8 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal /// The startDateTime of the role assignment schedule instance global::System.DateTime? StartDateTime { get; set; } /// The status of the role assignment schedule instance. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role assignment schedule instance type. string Type { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.json.cs index 766b2ffc06ed..7a778c902b63 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleInstance partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleInstance(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentScheduleInstance(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.PowerShell.cs index d5b07e3816bc..3e8bdce3b8f4 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleInstanceFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleInstanceFilter(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleInstanceFilter(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,25 +115,25 @@ internal RoleAssignmentScheduleInstanceFilter(global::System.Collections.IDictio // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("RoleAssignmentScheduleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -140,19 +148,19 @@ internal RoleAssignmentScheduleInstanceFilter(global::System.Management.Automati // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("RoleAssignmentScheduleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -161,6 +169,18 @@ internal RoleAssignmentScheduleInstanceFilter(global::System.Management.Automati /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule instance filter [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs index 5eb09eac3ac6..cc7c349cfe49 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.cs index f19fae2cd367..c4a5d7cb0022 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule instance filter public partial class RoleAssignmentScheduleInstanceFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal { /// Backing field for property. @@ -57,6 +57,9 @@ public partial interface IRoleAssignmentScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -67,6 +70,9 @@ public partial interface IRoleAssignmentScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances belonging to a specific role assignment schedule.", SerializedName = @"roleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +81,9 @@ public partial interface IRoleAssignmentScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +92,9 @@ public partial interface IRoleAssignmentScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances of the specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.json.cs index 74bba3426a14..a31d7c1abb7c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleInstanceFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleInstanceFilter(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentScheduleInstanceFilter(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_roleAssignmentScheduleId = If( json?.PropertyT("roleAssignmentScheduleId"), out var __jsonRoleAssignmentScheduleId) ? (string)__jsonRoleAssignmentScheduleId : (string)RoleAssignmentScheduleId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_roleAssignmentScheduleId = If( json?.PropertyT("roleAssignmentScheduleId"), out var __jsonRoleAssignmentScheduleId) ? (string)__jsonRoleAssignmentScheduleId : (string)_roleAssignmentScheduleId;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.PowerShell.cs index e6183d351817..93f077ac447d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleInstanceListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleInstanceListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleInstanceListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +116,17 @@ internal RoleAssignmentScheduleInstanceListResult(global::System.Collections.IDi // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +141,11 @@ internal RoleAssignmentScheduleInstanceListResult(global::System.Management.Auto // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleAssignmentScheduleInstanceListResult(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule instance list operation result. [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs index e6aee608c173..9765067969cc 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.cs index c767456e6e1e..ab97bf46a876 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule instance list operation result. public partial class RoleAssignmentScheduleInstanceListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleAssignmentScheduleInstanceListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[] _value; + private System.Collections.Generic.List _value; /// Role assignment schedule instance list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// /// Creates an new instance. @@ -43,6 +43,9 @@ public partial interface IRoleAssignmentScheduleInstanceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -51,10 +54,13 @@ public partial interface IRoleAssignmentScheduleInstanceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role assignment schedule instance list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance) })] + System.Collections.Generic.List Value { get; set; } } /// Role assignment schedule instance list operation result. @@ -64,7 +70,7 @@ internal partial interface IRoleAssignmentScheduleInstanceListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role assignment schedule instance list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.json.cs index a0ce042c5dce..6ddd4d04f078 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleInstanceListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleInstanceListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleAssignmentScheduleInstanceListResult(Microsoft.Azure.PowerShell.Cmd { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstance.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.PowerShell.cs new file mode 100644 index 000000000000..cbc7ad59380a --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.PowerShell.cs @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role assignment schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstancePropertiesTypeConverter))] + public partial class RoleAssignmentScheduleInstanceProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleInstanceProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleInstanceProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleInstanceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("OriginRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleInstanceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("OriginRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role assignment schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstancePropertiesTypeConverter))] + public partial interface IRoleAssignmentScheduleInstanceProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs index a7538c8785b5..f6f9ee36abab 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.cs similarity index 73% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.cs index 53bd03cbfa7f..2326990893aa 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule properties with scope. public partial class RoleAssignmentScheduleInstanceProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? _assignmentType; + private string _assignmentType; /// Assignment type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get => this._assignmentType; set => this._assignmentType = value; } + public string AssignmentType { get => this._assignmentType; set => this._assignmentType = value; } /// Backing field for property. private string _condition; @@ -53,22 +53,22 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set => this._expandedProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set => this._expandedProperty = value; } /// Backing field for property. private string _linkedRoleEligibilityScheduleId; @@ -87,23 +87,23 @@ public partial class RoleAssignmentScheduleInstanceProperties : public string LinkedRoleEligibilityScheduleInstanceId { get => this._linkedRoleEligibilityScheduleInstanceId; set => this._linkedRoleEligibilityScheduleInstanceId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? _memberType; + private string _memberType; /// Membership type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => this._memberType; set => this._memberType = value; } + public string MemberType { get => this._memberType; set => this._memberType = value; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } /// Backing field for property. private string _originRoleAssignmentId; @@ -114,11 +114,11 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Backing field for property. private string _principalId; @@ -128,11 +128,11 @@ public partial class RoleAssignmentScheduleInstanceProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; set => this._principalType = value; } + public string PrincipalType { get => this._principalType; set => this._principalType = value; } /// Backing field for property. private string _roleAssignmentScheduleId; @@ -143,7 +143,7 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } /// Backing field for property. private string _roleDefinitionId; @@ -154,7 +154,7 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Backing field for property. private string _scope; @@ -165,15 +165,15 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -183,11 +183,11 @@ public partial class RoleAssignmentScheduleInstanceProperties : public global::System.DateTime? StartDateTime { get => this._startDateTime; set => this._startDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role assignment schedule instance. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// /// Creates an new instance. @@ -205,10 +205,14 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Assignment type of the role assignment schedule", SerializedName = @"assignmentType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -216,6 +220,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -224,6 +231,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -232,6 +242,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -240,6 +253,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endDateTime of the role assignment schedule instance", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -248,6 +264,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -256,6 +275,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -264,6 +286,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -272,6 +297,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"roleEligibilityScheduleId used to activate", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -280,6 +308,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance", SerializedName = @"linkedRoleEligibilityScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -288,14 +319,21 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role assignment schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Role Assignment Id in external system [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role Assignment Id in external system", SerializedName = @"originRoleAssignmentId", PossibleTypes = new [] { typeof(string) })] @@ -304,6 +342,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -312,6 +353,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -320,6 +364,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -328,14 +375,21 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Id of the master role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the master role assignment schedule", SerializedName = @"roleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -344,6 +398,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -352,6 +409,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -360,6 +420,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -368,6 +431,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -376,6 +442,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -384,6 +453,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -392,6 +464,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -400,6 +475,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The startDateTime of the role assignment schedule instance", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -408,10 +486,14 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role assignment schedule instance.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } } /// Role assignment schedule properties with scope. @@ -419,7 +501,8 @@ internal partial interface IRoleAssignmentScheduleInstancePropertiesInternal { /// Assignment type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -438,19 +521,20 @@ internal partial interface IRoleAssignmentScheduleInstancePropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// roleEligibilityScheduleId used to activate string LinkedRoleEligibilityScheduleId { get; set; } /// roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance string LinkedRoleEligibilityScheduleInstanceId { get; set; } /// Membership type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Role Assignment Id in external system string OriginRoleAssignmentId { get; set; } /// Display name of the principal @@ -460,7 +544,8 @@ internal partial interface IRoleAssignmentScheduleInstancePropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Id of the master role assignment schedule string RoleAssignmentScheduleId { get; set; } /// Display name of the role definition @@ -480,7 +565,8 @@ internal partial interface IRoleAssignmentScheduleInstancePropertiesInternal /// The startDateTime of the role assignment schedule instance global::System.DateTime? StartDateTime { get; set; } /// The status of the role assignment schedule instance. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.json.cs index f20591bf853b..126a1b39efa6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleInstanceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleInstanceProperties(json) : null; } @@ -77,23 +77,23 @@ internal RoleAssignmentScheduleInstanceProperties(Microsoft.Azure.PowerShell.Cmd { return; } - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_roleAssignmentScheduleId = If( json?.PropertyT("roleAssignmentScheduleId"), out var __jsonRoleAssignmentScheduleId) ? (string)__jsonRoleAssignmentScheduleId : (string)RoleAssignmentScheduleId;} - {_originRoleAssignmentId = If( json?.PropertyT("originRoleAssignmentId"), out var __jsonOriginRoleAssignmentId) ? (string)__jsonOriginRoleAssignmentId : (string)OriginRoleAssignmentId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)LinkedRoleEligibilityScheduleId;} - {_linkedRoleEligibilityScheduleInstanceId = If( json?.PropertyT("linkedRoleEligibilityScheduleInstanceId"), out var __jsonLinkedRoleEligibilityScheduleInstanceId) ? (string)__jsonLinkedRoleEligibilityScheduleInstanceId : (string)LinkedRoleEligibilityScheduleInstanceId;} - {_assignmentType = If( json?.PropertyT("assignmentType"), out var __jsonAssignmentType) ? (string)__jsonAssignmentType : (string)AssignmentType;} - {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)MemberType;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_roleAssignmentScheduleId = If( json?.PropertyT("roleAssignmentScheduleId"), out var __jsonRoleAssignmentScheduleId) ? (string)__jsonRoleAssignmentScheduleId : (string)_roleAssignmentScheduleId;} + {_originRoleAssignmentId = If( json?.PropertyT("originRoleAssignmentId"), out var __jsonOriginRoleAssignmentId) ? (string)__jsonOriginRoleAssignmentId : (string)_originRoleAssignmentId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)_linkedRoleEligibilityScheduleId;} + {_linkedRoleEligibilityScheduleInstanceId = If( json?.PropertyT("linkedRoleEligibilityScheduleInstanceId"), out var __jsonLinkedRoleEligibilityScheduleInstanceId) ? (string)__jsonLinkedRoleEligibilityScheduleInstanceId : (string)_linkedRoleEligibilityScheduleInstanceId;} + {_assignmentType = If( json?.PropertyT("assignmentType"), out var __jsonAssignmentType) ? (string)__jsonAssignmentType : (string)_assignmentType;} + {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)_memberType;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.PowerShell.cs index 8574f3658e5a..d0fe750925f8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleListResult(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +113,17 @@ internal RoleAssignmentScheduleListResult(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -130,11 +138,11 @@ internal RoleAssignmentScheduleListResult(global::System.Management.Automation.P // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +151,18 @@ internal RoleAssignmentScheduleListResult(global::System.Management.Automation.P /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule list operation result. [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.TypeConverter.cs index d6c005506bf5..0dbc3bb8e96f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.cs index b9b291df372c..f96bc511b8df 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule list operation result. public partial class RoleAssignmentScheduleListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleAssignmentScheduleListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[] _value; + private System.Collections.Generic.List _value; /// Role assignment schedule list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public RoleAssignmentScheduleListResult() @@ -41,6 +41,9 @@ public partial interface IRoleAssignmentScheduleListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IRoleAssignmentScheduleListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role assignment schedule list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule) })] + System.Collections.Generic.List Value { get; set; } } /// Role assignment schedule list operation result. @@ -62,7 +68,7 @@ internal partial interface IRoleAssignmentScheduleListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role assignment schedule list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.json.cs index 610e5827be00..0da1eb4899d7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleAssignmentScheduleListResult(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedule.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.PowerShell.cs new file mode 100644 index 000000000000..2992fca86d9c --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.PowerShell.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role assignment schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentSchedulePropertiesTypeConverter))] + public partial class RoleAssignmentScheduleProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleRequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId = (string) content.GetValueForProperty("RoleAssignmentScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleRequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId = (string) content.GetValueForProperty("RoleAssignmentScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role assignment schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentSchedulePropertiesTypeConverter))] + public partial interface IRoleAssignmentScheduleProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.TypeConverter.cs index 1a51e939bd63..91273fe7e889 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.cs similarity index 72% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.cs index 279e8456cba5..fca9bbc4b4a1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule properties with scope. public partial class RoleAssignmentScheduleProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? _assignmentType; + private string _assignmentType; /// Assignment type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get => this._assignmentType; set => this._assignmentType = value; } + public string AssignmentType { get => this._assignmentType; set => this._assignmentType = value; } /// Backing field for property. private string _condition; @@ -53,22 +53,22 @@ public partial class RoleAssignmentScheduleProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set => this._expandedProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set => this._expandedProperty = value; } /// Backing field for property. private string _linkedRoleEligibilityScheduleId; @@ -78,31 +78,31 @@ public partial class RoleAssignmentScheduleProperties : public string LinkedRoleEligibilityScheduleId { get => this._linkedRoleEligibilityScheduleId; set => this._linkedRoleEligibilityScheduleId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? _memberType; + private string _memberType; /// Membership type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => this._memberType; set => this._memberType = value; } + public string MemberType { get => this._memberType; set => this._memberType = value; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Backing field for property. private string _principalId; @@ -112,11 +112,11 @@ public partial class RoleAssignmentScheduleProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; set => this._principalType = value; } + public string PrincipalType { get => this._principalType; set => this._principalType = value; } /// Backing field for property. private string _roleAssignmentScheduleRequestId; @@ -129,7 +129,7 @@ public partial class RoleAssignmentScheduleProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } /// Backing field for property. private string _roleDefinitionId; @@ -140,7 +140,7 @@ public partial class RoleAssignmentScheduleProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Backing field for property. private string _scope; @@ -151,15 +151,15 @@ public partial class RoleAssignmentScheduleProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -169,11 +169,11 @@ public partial class RoleAssignmentScheduleProperties : public global::System.DateTime? StartDateTime { get => this._startDateTime; set => this._startDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Backing field for property. private global::System.DateTime? _updatedOn; @@ -196,10 +196,14 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Assignment type of the role assignment schedule", SerializedName = @"assignmentType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -207,6 +211,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -215,6 +222,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -223,6 +233,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -231,6 +244,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime when role assignment schedule", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -239,6 +255,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -247,6 +266,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -255,6 +277,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -263,6 +288,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -271,14 +299,21 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role assignment schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -287,6 +322,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -295,6 +333,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -303,16 +344,23 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule", SerializedName = @"roleAssignmentScheduleRequestId", PossibleTypes = new [] { typeof(string) })] @@ -321,6 +369,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -329,6 +380,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -337,6 +391,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -345,6 +402,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -353,6 +413,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -361,6 +424,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -369,6 +435,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -377,6 +446,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime when role assignment schedule", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -385,14 +457,21 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role assignment schedule.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// DateTime when role assignment schedule was modified [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was modified", SerializedName = @"updatedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -404,7 +483,8 @@ internal partial interface IRoleAssignmentSchedulePropertiesInternal { /// Assignment type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -423,17 +503,18 @@ internal partial interface IRoleAssignmentSchedulePropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule string LinkedRoleEligibilityScheduleId { get; set; } /// Membership type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal string PrincipalDisplayName { get; set; } /// Email id of the principal @@ -441,7 +522,8 @@ internal partial interface IRoleAssignmentSchedulePropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// @@ -463,7 +545,8 @@ internal partial interface IRoleAssignmentSchedulePropertiesInternal /// Start DateTime when role assignment schedule global::System.DateTime? StartDateTime { get; set; } /// The status of the role assignment schedule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// DateTime when role assignment schedule was modified global::System.DateTime? UpdatedOn { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.json.cs index 58fc49c398fa..063f17766a04 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleProperties(json) : null; } @@ -77,22 +77,22 @@ internal RoleAssignmentScheduleProperties(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_roleAssignmentScheduleRequestId = If( json?.PropertyT("roleAssignmentScheduleRequestId"), out var __jsonRoleAssignmentScheduleRequestId) ? (string)__jsonRoleAssignmentScheduleRequestId : (string)RoleAssignmentScheduleRequestId;} - {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)LinkedRoleEligibilityScheduleId;} - {_assignmentType = If( json?.PropertyT("assignmentType"), out var __jsonAssignmentType) ? (string)__jsonAssignmentType : (string)AssignmentType;} - {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)MemberType;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} - {_updatedOn = If( json?.PropertyT("updatedOn"), out var __jsonUpdatedOn) ? global::System.DateTime.TryParse((string)__jsonUpdatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedOnValue) ? __jsonUpdatedOnValue : UpdatedOn : UpdatedOn;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_roleAssignmentScheduleRequestId = If( json?.PropertyT("roleAssignmentScheduleRequestId"), out var __jsonRoleAssignmentScheduleRequestId) ? (string)__jsonRoleAssignmentScheduleRequestId : (string)_roleAssignmentScheduleRequestId;} + {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)_linkedRoleEligibilityScheduleId;} + {_assignmentType = If( json?.PropertyT("assignmentType"), out var __jsonAssignmentType) ? (string)__jsonAssignmentType : (string)_assignmentType;} + {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)_memberType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} + {_updatedOn = If( json?.PropertyT("updatedOn"), out var __jsonUpdatedOn) ? global::System.DateTime.TryParse((string)__jsonUpdatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedOnValue) ? __jsonUpdatedOnValue : _updatedOn : _updatedOn;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.PowerShell.cs new file mode 100644 index 000000000000..89581bd2c59f --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.PowerShell.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role Assignment schedule request + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestTypeConverter))] + public partial class RoleAssignmentScheduleRequest + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration, 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 RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration, 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.Resources.Authorization.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(); + } + } + /// Role Assignment schedule request + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestTypeConverter))] + public partial interface IRoleAssignmentScheduleRequest + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.TypeConverter.cs index 3ba5876a023b..7bb81b3dd7be 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.cs index 4543f7bc7ffd..5f89ba6d7330 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.cs @@ -3,20 +3,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role Assignment schedule request public partial class RoleAssignmentScheduleRequest : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal { /// The approvalId of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId; } + public string ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] @@ -24,47 +24,47 @@ public partial class RoleAssignmentScheduleRequest : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role assignment schedule request was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn; } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn; } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationDuration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationDuration = value ?? null; } /// End DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime = value ?? default(global::System.DateTime); } /// Type of the role assignment schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationType = value ?? null; } /// Backing field for property. private string _id; @@ -77,63 +77,93 @@ public partial class RoleAssignmentScheduleRequest : /// Justification for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Justification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Justification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Justification = value ?? null; } + public string Justification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Justification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Justification = value ?? null; } /// The linked role eligibility schedule id - to activate an eligibility. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } + public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } /// Internal Acessors for ApprovalId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId = value ?? null; } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExpandedPropertiesPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesPrincipalType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PrincipalDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + + /// Internal Acessors for PrincipalEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail = value ?? null; } /// Internal Acessors for PrincipalType - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties()); set { {_property = value;} } } /// Internal Acessors for RequestorId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId = value ?? null; } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// Internal Acessors for ScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ScheduleInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScheduleInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfo = value ?? null /* model class */; } /// Internal Acessors for ScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope = value ?? null; } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType = value ?? null; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status = value ?? null; } /// Internal Acessors for TicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.TicketInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.TicketInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfo = value ?? null /* model class */; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -146,42 +176,42 @@ public partial class RoleAssignmentScheduleRequest : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType; } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties _property; /// Role assignment schedule request properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties()); set => this._property = value; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType)""); } + public string RequestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestType = value ?? null; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId; } + public string RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -191,69 +221,69 @@ public partial class RoleAssignmentScheduleRequest : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime = value ?? default(global::System.DateTime); } /// The role assignment schedule request scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType; } /// The status of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TargetRoleAssignmentScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleId = value ?? null; } + public string TargetRoleAssignmentScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleId = value ?? null; } /// The role assignment schedule instance id being updated [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TargetRoleAssignmentScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleInstanceId = value ?? null; } + public string TargetRoleAssignmentScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleInstanceId = value ?? null; } /// Ticket number for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber = value ?? null; } + public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber = value ?? null; } /// Ticket system name for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem = value ?? null; } + public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem = value ?? null; } /// Backing field for property. private string _type; @@ -277,6 +307,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The approvalId of the role assignment schedule request.", SerializedName = @"approvalId", PossibleTypes = new [] { typeof(string) })] @@ -288,6 +321,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -296,6 +332,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -304,6 +343,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime when role assignment schedule request was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -311,31 +353,43 @@ public partial interface IRoleAssignmentScheduleRequest : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalId { get; set; } + string ExpandedPropertiesPrincipalId { get; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalType { get; set; } + string ExpandedPropertiesPrincipalType { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesRoleDefinitionId { get; set; } + string ExpandedPropertiesRoleDefinitionId { get; } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role assignment schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -344,6 +398,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role assignment schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -352,14 +409,21 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// The role assignment schedule request ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -368,6 +432,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Justification for the role assignment", SerializedName = @"justification", PossibleTypes = new [] { typeof(string) })] @@ -376,6 +443,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The linked role eligibility schedule id - to activate an eligibility.", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -384,6 +454,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -391,23 +464,32 @@ public partial interface IRoleAssignmentScheduleRequest : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string PrincipalDisplayName { get; set; } + string PrincipalDisplayName { get; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string PrincipalEmail { get; set; } + string PrincipalEmail { get; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -416,24 +498,35 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the user who created this request", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -441,15 +534,21 @@ public partial interface IRoleAssignmentScheduleRequest : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -457,15 +556,21 @@ public partial interface IRoleAssignmentScheduleRequest : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role assignment schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -474,6 +579,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -481,41 +589,57 @@ public partial interface IRoleAssignmentScheduleRequest : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The status of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the role assignment schedule request.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resultant role assignment schedule id or the role assignment schedule id being updated", SerializedName = @"targetRoleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -524,6 +648,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule instance id being updated", SerializedName = @"targetRoleAssignmentScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -532,6 +659,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role assignment", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -540,6 +670,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role assignment", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] @@ -548,6 +681,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -576,19 +712,20 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Duration of the role assignment schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role assignment schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role assignment schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// The role assignment schedule request ID. string Id { get; set; } /// Justification for the role assignment @@ -604,13 +741,15 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role assignment schedule request properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties Property { get; set; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request string RequestorId { get; set; } /// Display name of the role definition @@ -620,9 +759,9 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Schedule info of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } /// Expiration of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } /// Start DateTime of the role assignment schedule. global::System.DateTime? ScheduleInfoStartDateTime { get; set; } /// The role assignment schedule request scope. @@ -634,7 +773,8 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// Type of the resource string ScopeType { get; set; } /// The status of the role assignment schedule request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// @@ -642,7 +782,7 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// The role assignment schedule instance id being updated string TargetRoleAssignmentScheduleInstanceId { get; set; } /// Ticket Info of the role assignment - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } /// Ticket number for the role assignment string TicketInfoTicketNumber { get; set; } /// Ticket system name for the role assignment diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.json.cs index 5c3fcd5451f7..aa6e555acf18 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequest(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentScheduleRequest(Microsoft.Azure.PowerShell.Cmdlets.Resour { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.PowerShell.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.PowerShell.cs index 43761e1d24b6..a8b42e2d2b31 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestFilter(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestFilter(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,25 +115,25 @@ internal RoleAssignmentScheduleRequestFilter(global::System.Collections.IDiction // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("RequestorId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -140,19 +148,19 @@ internal RoleAssignmentScheduleRequestFilter(global::System.Management.Automatio // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("RequestorId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -161,6 +169,18 @@ internal RoleAssignmentScheduleRequestFilter(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule request filter [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.TypeConverter.cs index f2a422e72899..4842c87ed959 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.cs index 02b948ec2df2..3acc29354ed1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule request filter public partial class RoleAssignmentScheduleRequestFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IRoleAssignmentScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment requests of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IRoleAssignmentScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment requests created by specific principal.", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IRoleAssignmentScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment requests of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IRoleAssignmentScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment requests of specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.json.cs index 5b00e31a7849..58b6d6de0766 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestFilter(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentScheduleRequestFilter(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)RequestorId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)_requestorId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.PowerShell.cs index b7af05198cf4..98f5843b901b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +116,17 @@ internal RoleAssignmentScheduleRequestListResult(global::System.Collections.IDic // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +141,11 @@ internal RoleAssignmentScheduleRequestListResult(global::System.Management.Autom // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleAssignmentScheduleRequestListResult(global::System.Management.Autom /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule request list operation result. [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.TypeConverter.cs index 866cf4db01c7..e34ef00fd8c6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.cs index 34d93c892333..f51183b9e85b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule request list operation result. public partial class RoleAssignmentScheduleRequestListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleAssignmentScheduleRequestListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[] _value; + private System.Collections.Generic.List _value; /// Role assignment schedule request list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public RoleAssignmentScheduleRequestListResult() @@ -41,6 +41,9 @@ public partial interface IRoleAssignmentScheduleRequestListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IRoleAssignmentScheduleRequestListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role assignment schedule request list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest) })] + System.Collections.Generic.List Value { get; set; } } /// Role assignment schedule request list operation result. @@ -62,7 +68,7 @@ internal partial interface IRoleAssignmentScheduleRequestListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role assignment schedule request list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.json.cs index 6aa0fc3eac9a..8b8d67837012 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleAssignmentScheduleRequestListResult(Microsoft.Azure.PowerShell.Cmdl { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.PowerShell.cs new file mode 100644 index 000000000000..56cb8cccd832 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.PowerShell.cs @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role assignment schedule request properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTypeConverter))] + public partial class RoleAssignmentScheduleRequestProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleRequestProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleRequestProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleRequestProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration, 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 RoleAssignmentScheduleRequestProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration, 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.Resources.Authorization.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(); + } + } + /// Role assignment schedule request properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTypeConverter))] + public partial interface IRoleAssignmentScheduleRequestProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.TypeConverter.cs index ac5f5de46335..cbc9518b93b0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.cs similarity index 62% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.cs index ab748edbfd9c..5573d68c998d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule request properties with scope. public partial class RoleAssignmentScheduleRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal { /// Backing field for property. @@ -46,34 +46,34 @@ public partial class RoleAssignmentScheduleRequestProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration = value ?? null; } /// End DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime = value ?? default(global::System.DateTime); } /// Type of the role assignment schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType = value ?? null; } /// Backing field for property. private string _justification; @@ -90,51 +90,81 @@ public partial class RoleAssignmentScheduleRequestProperties : public string LinkedRoleEligibilityScheduleId { get => this._linkedRoleEligibilityScheduleId; set => this._linkedRoleEligibilityScheduleId = value; } /// Internal Acessors for ApprovalId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ApprovalId { get => this._approvalId; set { {_approvalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ApprovalId { get => this._approvalId; set { {_approvalId = value;} } } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + + /// Internal Acessors for ExpandedPropertiesPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesPrincipalType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } + + /// Internal Acessors for PrincipalDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + + /// Internal Acessors for PrincipalEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Internal Acessors for PrincipalType - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.PrincipalType { get => this._principalType; set { {_principalType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.PrincipalType { get => this._principalType; set { {_principalType = value;} } } /// Internal Acessors for RequestorId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.RequestorId { get => this._requestorId; set { {_requestorId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.RequestorId { get => this._requestorId; set { {_requestorId = value;} } } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Internal Acessors for ScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo()); set { {_scheduleInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo()); set { {_scheduleInfo = value;} } } /// Internal Acessors for ScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Internal Acessors for TicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo()); set { {_ticketInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo()); set { {_ticketInfo = value;} } } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; } /// Backing field for property. private string _principalId; @@ -144,20 +174,20 @@ public partial class RoleAssignmentScheduleRequestProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; } + public string PrincipalType { get => this._principalType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType _requestType; + private string _requestType; /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get => this._requestType; set => this._requestType = value; } + public string RequestType { get => this._requestType; set => this._requestType = value; } /// Backing field for property. private string _requestorId; @@ -168,7 +198,7 @@ public partial class RoleAssignmentScheduleRequestProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; } /// Backing field for property. private string _roleDefinitionId; @@ -179,18 +209,18 @@ public partial class RoleAssignmentScheduleRequestProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo _scheduleInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo _scheduleInfo; /// Schedule info of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo()); set => this._scheduleInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo()); set => this._scheduleInfo = value; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime = value ?? default(global::System.DateTime); } /// Backing field for property. private string _scope; @@ -201,22 +231,22 @@ public partial class RoleAssignmentScheduleRequestProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; } + public string Status { get => this._status; } /// Backing field for property. private string _targetRoleAssignmentScheduleId; @@ -237,19 +267,19 @@ public partial class RoleAssignmentScheduleRequestProperties : public string TargetRoleAssignmentScheduleInstanceId { get => this._targetRoleAssignmentScheduleInstanceId; set => this._targetRoleAssignmentScheduleInstanceId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo _ticketInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo _ticketInfo; /// Ticket Info of the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo()); set => this._ticketInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo()); set => this._ticketInfo = value; } /// Ticket number for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber = value ?? null; } + public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber = value ?? null; } /// Ticket system name for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem = value ?? null; } + public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem = value ?? null; } /// Creates an new instance. public RoleAssignmentScheduleRequestProperties() @@ -265,6 +295,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The approvalId of the role assignment schedule request.", SerializedName = @"approvalId", PossibleTypes = new [] { typeof(string) })] @@ -276,6 +309,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -284,6 +320,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -292,6 +331,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime when role assignment schedule request was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -299,31 +341,43 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalId { get; set; } + string ExpandedPropertiesPrincipalId { get; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalType { get; set; } + string ExpandedPropertiesPrincipalType { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesRoleDefinitionId { get; set; } + string ExpandedPropertiesRoleDefinitionId { get; } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role assignment schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -332,6 +386,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role assignment schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -340,14 +397,21 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Justification for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Justification for the role assignment", SerializedName = @"justification", PossibleTypes = new [] { typeof(string) })] @@ -356,6 +420,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The linked role eligibility schedule id - to activate an eligibility.", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -363,23 +430,32 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string PrincipalDisplayName { get; set; } + string PrincipalDisplayName { get; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string PrincipalEmail { get; set; } + string PrincipalEmail { get; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -388,24 +464,35 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the user who created this request", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -413,15 +500,21 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -429,15 +522,21 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role assignment schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -446,6 +545,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -453,41 +555,57 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The status of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the role assignment schedule request.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resultant role assignment schedule id or the role assignment schedule id being updated", SerializedName = @"targetRoleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -496,6 +614,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule instance id being updated", SerializedName = @"targetRoleAssignmentScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -504,6 +625,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role assignment", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -512,6 +636,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role assignment", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] @@ -540,19 +667,20 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Duration of the role assignment schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role assignment schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role assignment schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Justification for the role assignment string Justification { get; set; } /// The linked role eligibility schedule id - to activate an eligibility. @@ -564,11 +692,13 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request string RequestorId { get; set; } /// Display name of the role definition @@ -578,9 +708,9 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Schedule info of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } /// Expiration of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } /// Start DateTime of the role assignment schedule. global::System.DateTime? ScheduleInfoStartDateTime { get; set; } /// The role assignment schedule request scope. @@ -592,7 +722,8 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// Type of the resource string ScopeType { get; set; } /// The status of the role assignment schedule request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// @@ -600,7 +731,7 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// The role assignment schedule instance id being updated string TargetRoleAssignmentScheduleInstanceId { get; set; } /// Ticket Info of the role assignment - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } /// Ticket number for the role assignment string TicketInfoTicketNumber { get; set; } /// Ticket system name for the role assignment diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.json.cs similarity index 91% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.json.cs index f04c360bb536..04e177588520 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestProperties(json) : null; } @@ -77,24 +77,24 @@ internal RoleAssignmentScheduleRequestProperties(Microsoft.Azure.PowerShell.Cmdl { return; } - {_scheduleInfo = If( json?.PropertyT("scheduleInfo"), out var __jsonScheduleInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo.FromJson(__jsonScheduleInfo) : ScheduleInfo;} - {_ticketInfo = If( json?.PropertyT("ticketInfo"), out var __jsonTicketInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo.FromJson(__jsonTicketInfo) : TicketInfo;} - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_requestType = If( json?.PropertyT("requestType"), out var __jsonRequestType) ? (string)__jsonRequestType : (string)RequestType;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_approvalId = If( json?.PropertyT("approvalId"), out var __jsonApprovalId) ? (string)__jsonApprovalId : (string)ApprovalId;} - {_targetRoleAssignmentScheduleId = If( json?.PropertyT("targetRoleAssignmentScheduleId"), out var __jsonTargetRoleAssignmentScheduleId) ? (string)__jsonTargetRoleAssignmentScheduleId : (string)TargetRoleAssignmentScheduleId;} - {_targetRoleAssignmentScheduleInstanceId = If( json?.PropertyT("targetRoleAssignmentScheduleInstanceId"), out var __jsonTargetRoleAssignmentScheduleInstanceId) ? (string)__jsonTargetRoleAssignmentScheduleInstanceId : (string)TargetRoleAssignmentScheduleInstanceId;} - {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)LinkedRoleEligibilityScheduleId;} - {_justification = If( json?.PropertyT("justification"), out var __jsonJustification) ? (string)__jsonJustification : (string)Justification;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} - {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)RequestorId;} + {_scheduleInfo = If( json?.PropertyT("scheduleInfo"), out var __jsonScheduleInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo.FromJson(__jsonScheduleInfo) : _scheduleInfo;} + {_ticketInfo = If( json?.PropertyT("ticketInfo"), out var __jsonTicketInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo.FromJson(__jsonTicketInfo) : _ticketInfo;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_requestType = If( json?.PropertyT("requestType"), out var __jsonRequestType) ? (string)__jsonRequestType : (string)_requestType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_approvalId = If( json?.PropertyT("approvalId"), out var __jsonApprovalId) ? (string)__jsonApprovalId : (string)_approvalId;} + {_targetRoleAssignmentScheduleId = If( json?.PropertyT("targetRoleAssignmentScheduleId"), out var __jsonTargetRoleAssignmentScheduleId) ? (string)__jsonTargetRoleAssignmentScheduleId : (string)_targetRoleAssignmentScheduleId;} + {_targetRoleAssignmentScheduleInstanceId = If( json?.PropertyT("targetRoleAssignmentScheduleInstanceId"), out var __jsonTargetRoleAssignmentScheduleInstanceId) ? (string)__jsonTargetRoleAssignmentScheduleInstanceId : (string)_targetRoleAssignmentScheduleInstanceId;} + {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)_linkedRoleEligibilityScheduleId;} + {_justification = If( json?.PropertyT("justification"), out var __jsonJustification) ? (string)__jsonJustification : (string)_justification;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} + {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)_requestorId;} AfterFromJson(json); } @@ -121,26 +121,26 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J } AddIf( null != this._scheduleInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._scheduleInfo.ToJson(null,serializationMode) : null, "scheduleInfo" ,container.Add ); AddIf( null != this._ticketInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._ticketInfo.ToJson(null,serializationMode) : null, "ticketInfo" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._expandedProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._expandedProperty.ToJson(null,serializationMode) : null, "expandedProperties" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); } AddIf( null != (((object)this._roleDefinitionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._roleDefinitionId.ToString()) : null, "roleDefinitionId" ,container.Add ); AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._principalType.ToString()) : null, "principalType" ,container.Add ); } AddIf( null != (((object)this._requestType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._requestType.ToString()) : null, "requestType" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._approvalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._approvalId.ToString()) : null, "approvalId" ,container.Add ); } @@ -150,11 +150,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J AddIf( null != (((object)this._justification)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._justification.ToString()) : null, "justification" ,container.Add ); AddIf( null != (((object)this._condition)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._condition.ToString()) : null, "condition" ,container.Add ); AddIf( null != (((object)this._conditionVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._conditionVersion.ToString()) : null, "conditionVersion" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._createdOn ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._createdOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdOn" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._requestorId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._requestorId.ToString()) : null, "requestorId" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs similarity index 57% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs index 4aa554859bf7..5fd6603016cc 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestPropertiesScheduleInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestPropertiesScheduleInfo(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,29 +116,29 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfo(global::System.Coll // actually deserialize if (content.Contains("Expiration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); } if (content.Contains("StartDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, global::System.Convert.ToString); } if (content.Contains("ExpirationEndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -145,23 +153,23 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfo(global::System.Mana // actually deserialize if (content.Contains("Expiration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); } if (content.Contains("StartDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, global::System.Convert.ToString); } if (content.Contains("ExpirationEndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -170,6 +178,18 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfo(global::System.Mana /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Schedule info of the role assignment schedule [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs index 6c5eb923551c..807f69a4764b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs index 165dc3c81ab9..1d6df57ee420 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs @@ -3,37 +3,37 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Schedule info of the role assignment schedule public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfo : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration _expiration; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration _expiration; /// Expiration of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration()); set => this._expiration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration()); set => this._expiration = value; } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration = value ?? null; } /// End DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime = value ?? default(global::System.DateTime); } /// Type of the role assignment schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type = value ?? null; } /// Internal Acessors for Expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal.Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration()); set { {_expiration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal.Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration()); set { {_expiration = value;} } } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -58,6 +58,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role assignment schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +69,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role assignment schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -74,14 +80,21 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role assignment schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -93,13 +106,14 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoI { /// Expiration of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Expiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Expiration { get; set; } /// Duration of the role assignment schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role assignment schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role assignment schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Start DateTime of the role assignment schedule. global::System.DateTime? StartDateTime { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs index 07ce83d1bd22..dccf8036c703 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestPropertiesScheduleInfo(json) : null; } @@ -78,8 +78,8 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfo(Microsoft.Azure.Pow { return; } - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.FromJson(__jsonExpiration) : Expiration;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.FromJson(__jsonExpiration) : _expiration;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs index 717d988ca5b3..4d936978e816 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirati partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,21 +116,21 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(global::S // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("EndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Duration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,15 +145,15 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(global::S // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("EndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Duration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,6 +162,18 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(global::S /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Expiration of the role assignment schedule [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs index 24e1344a1c47..64ef0384853d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is /// no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs similarity index 82% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs index 39baa9db2628..6c2bc953272f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Expiration of the role assignment schedule public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirati public global::System.DateTime? EndDateTime { get => this._endDateTime; set => this._endDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? _type; + private string _type; /// Type of the role assignment schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// /// Creates an new instance. @@ -50,6 +50,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoExp [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role assignment schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -58,6 +61,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoExp [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role assignment schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -66,10 +72,14 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoExp [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string Type { get; set; } } /// Expiration of the role assignment schedule @@ -81,7 +91,8 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoE /// End DateTime of the role assignment schedule. global::System.DateTime? EndDateTime { get; set; } /// Type of the role assignment schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs index f3f6832505bb..cef2548e60d7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirati partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(json) : null; } @@ -78,9 +78,9 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(Microsoft { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? (string)__jsonDuration : (string)Duration;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? (string)__jsonDuration : (string)_duration;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs index a8c6984748be..4bed6e5f5bc6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestPropertiesTicketInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestPropertiesTicketInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestPropertiesTicketInfo(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +116,17 @@ internal RoleAssignmentScheduleRequestPropertiesTicketInfo(global::System.Collec // actually deserialize if (content.Contains("TicketNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); } if (content.Contains("TicketSystem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +141,11 @@ internal RoleAssignmentScheduleRequestPropertiesTicketInfo(global::System.Manage // actually deserialize if (content.Contains("TicketNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); } if (content.Contains("TicketSystem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleAssignmentScheduleRequestPropertiesTicketInfo(global::System.Manage /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Ticket Info of the role assignment [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs index bef679bcab83..05a17a3ab20c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs index f74411f22c33..617930757eb7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Ticket Info of the role assignment public partial class RoleAssignmentScheduleRequestPropertiesTicketInfo : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal { /// Backing field for property. @@ -43,6 +43,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesTicketInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role assignment", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -51,6 +54,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesTicketInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role assignment", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs index 677d87f7e81f..6f2153230290 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestPropertiesTicketInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestPropertiesTicketInfo(json) : null; } @@ -78,8 +78,8 @@ internal RoleAssignmentScheduleRequestPropertiesTicketInfo(Microsoft.Azure.Power { return; } - {_ticketNumber = If( json?.PropertyT("ticketNumber"), out var __jsonTicketNumber) ? (string)__jsonTicketNumber : (string)TicketNumber;} - {_ticketSystem = If( json?.PropertyT("ticketSystem"), out var __jsonTicketSystem) ? (string)__jsonTicketSystem : (string)TicketSystem;} + {_ticketNumber = If( json?.PropertyT("ticketNumber"), out var __jsonTicketNumber) ? (string)__jsonTicketNumber : (string)_ticketNumber;} + {_ticketSystem = If( json?.PropertyT("ticketSystem"), out var __jsonTicketSystem) ? (string)__jsonTicketSystem : (string)_ticketSystem;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.PowerShell.cs new file mode 100644 index 000000000000..7c6a7753b6ca --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.PowerShell.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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role eligibility schedule + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleTypeConverter))] + public partial class RoleEligibilitySchedule + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilitySchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilitySchedule(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.Resources.Authorization.Models.IRoleEligibilitySchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilitySchedule(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.Resources.Authorization.Models.IRoleEligibilitySchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilitySchedule(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.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RequestId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilitySchedule(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.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RequestId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role eligibility schedule + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleTypeConverter))] + public partial interface IRoleEligibilitySchedule + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.TypeConverter.cs index 3b99ee7a8dec..3f19f3ae0c22 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.cs index bbb292bf84c0..7360b44f4061 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule public partial class RoleEligibilitySchedule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal { /// @@ -19,37 +19,37 @@ public partial class RoleEligibilitySchedule : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role eligibility schedule was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } /// End DateTime when role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Backing field for property. private string _id; @@ -62,31 +62,31 @@ public partial class RoleEligibilitySchedule : /// Membership type of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).MemberType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType)""); } + public string MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).MemberType = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -99,37 +99,37 @@ public partial class RoleEligibilitySchedule : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalEmail = value ?? null; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType)""); } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties _property; /// role eligibility schedule properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties()); set => this._property = value; } /// /// The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RequestId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleEligibilityScheduleRequestId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleEligibilityScheduleRequestId = value ?? null; } + public string RequestId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleEligibilityScheduleRequestId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleEligibilityScheduleRequestId = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -139,47 +139,47 @@ public partial class RoleEligibilitySchedule : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// The role eligibility schedule scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Scope = value ?? null; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeType = value ?? null; } /// Start DateTime when role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } /// The status of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Status = value ?? null; } /// Backing field for property. private string _type; @@ -192,7 +192,7 @@ public partial class RoleEligibilitySchedule : /// DateTime when role eligibility schedule was modified [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? UpdatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).UpdatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).UpdatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? UpdatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).UpdatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).UpdatedOn = value ?? default(global::System.DateTime); } /// Creates an new instance. public RoleEligibilitySchedule() @@ -211,6 +211,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -219,6 +222,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -227,6 +233,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -235,6 +244,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime when role eligibility schedule", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -243,6 +255,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -251,6 +266,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -259,6 +277,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -267,6 +288,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -275,14 +299,21 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role eligibility schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role eligibility schedule name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -291,6 +322,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -299,6 +333,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -307,6 +344,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -315,16 +355,23 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule", SerializedName = @"roleEligibilityScheduleRequestId", PossibleTypes = new [] { typeof(string) })] @@ -333,6 +380,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -341,6 +391,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -349,6 +402,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -357,6 +413,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -365,6 +424,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -373,6 +435,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -381,6 +446,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -389,6 +457,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime when role eligibility schedule", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -397,14 +468,21 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role eligibility schedule.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role eligibility schedule type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -413,6 +491,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was modified", SerializedName = @"updatedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -441,17 +522,18 @@ internal partial interface IRoleEligibilityScheduleInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The role eligibility schedule Id. string Id { get; set; } /// Membership type of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role eligibility schedule name. string Name { get; set; } /// Display name of the principal @@ -461,9 +543,10 @@ internal partial interface IRoleEligibilityScheduleInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// role eligibility schedule properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties Property { get; set; } /// /// The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule /// @@ -485,7 +568,8 @@ internal partial interface IRoleEligibilityScheduleInternal /// Start DateTime when role eligibility schedule global::System.DateTime? StartDateTime { get; set; } /// The status of the role eligibility schedule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role eligibility schedule type. string Type { get; set; } /// DateTime when role eligibility schedule was modified diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.json.cs index 49f05d366447..59d8c8f13c79 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilitySchedule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilitySchedule(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilitySchedule(Microsoft.Azure.PowerShell.Cmdlets.Resources.Au { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.PowerShell.cs index 64703d914b7f..5233e92d1dc6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleFilter(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleFilter(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,21 +113,21 @@ internal RoleEligibilityScheduleFilter(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +142,15 @@ internal RoleEligibilityScheduleFilter(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal RoleEligibilityScheduleFilter(global::System.Management.Automation.PSOb /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule filter [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.TypeConverter.cs index 40fe4a8288e6..858a6981cd5c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.cs index 1e17ed43c220..a21928c62d0c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule filter public partial class RoleEligibilityScheduleFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IRoleEligibilityScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IRoleEligibilityScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IRoleEligibilityScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule of the specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.json.cs index d0efb268a4b7..d7f1dd94ddd6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleFilter(json) : null; } @@ -77,9 +77,9 @@ internal RoleEligibilityScheduleFilter(Microsoft.Azure.PowerShell.Cmdlets.Resour { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.PowerShell.cs new file mode 100644 index 000000000000..bccc8d5df91e --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.PowerShell.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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Information about current or upcoming role eligibility schedule instance + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceTypeConverter))] + public partial class RoleEligibilityScheduleInstance + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Information about current or upcoming role eligibility schedule instance + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceTypeConverter))] + public partial interface IRoleEligibilityScheduleInstance + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.TypeConverter.cs index 392136c8bba6..fd2a52d527f3 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.cs index d4eeed71f0d1..7924254175bd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Information about current or upcoming role eligibility schedule instance public partial class RoleEligibilityScheduleInstance : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal { /// @@ -19,37 +19,37 @@ public partial class RoleEligibilityScheduleInstance : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role eligibility schedule was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } /// The endDateTime of the role eligibility schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Backing field for property. private string _id; @@ -62,31 +62,31 @@ public partial class RoleEligibilityScheduleInstance : /// Membership type of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).MemberType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType)""); } + public string MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).MemberType = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -99,30 +99,30 @@ public partial class RoleEligibilityScheduleInstance : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalEmail = value ?? null; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType)""); } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties _property; /// Role eligibility schedule instance properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -132,52 +132,52 @@ public partial class RoleEligibilityScheduleInstance : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// Id of the master role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleEligibilityScheduleId = value ?? null; } + public string RoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleEligibilityScheduleId = value ?? null; } /// The role eligibility schedule scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Scope = value ?? null; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeType = value ?? null; } /// The startDateTime of the role eligibility schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } /// The status of the role eligibility schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Status = value ?? null; } /// Backing field for property. private string _type; @@ -204,6 +204,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -212,6 +215,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -220,6 +226,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -228,6 +237,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endDateTime of the role eligibility schedule instance", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -236,6 +248,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -244,6 +259,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -252,6 +270,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -260,6 +281,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule instance ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -268,14 +292,21 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role eligibility schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role eligibility schedule instance name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule instance name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -284,6 +315,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -292,6 +326,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -300,6 +337,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -308,14 +348,21 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -324,6 +371,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -332,6 +382,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -340,6 +393,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the master role eligibility schedule", SerializedName = @"roleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -348,6 +404,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -356,6 +415,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -364,6 +426,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -372,6 +437,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -380,6 +448,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The startDateTime of the role eligibility schedule instance", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -388,14 +459,21 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role eligibility schedule instance", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role eligibility schedule instance type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule instance type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -424,17 +502,18 @@ internal partial interface IRoleEligibilityScheduleInstanceInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The role eligibility schedule instance ID. string Id { get; set; } /// Membership type of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role eligibility schedule instance name. string Name { get; set; } /// Display name of the principal @@ -444,9 +523,10 @@ internal partial interface IRoleEligibilityScheduleInstanceInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role eligibility schedule instance properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties Property { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// The role definition ID. @@ -466,7 +546,8 @@ internal partial interface IRoleEligibilityScheduleInstanceInternal /// The startDateTime of the role eligibility schedule instance global::System.DateTime? StartDateTime { get; set; } /// The status of the role eligibility schedule instance - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role eligibility schedule instance type. string Type { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.json.cs index ac8066365408..30dadd00cfda 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleInstance partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleInstance(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilityScheduleInstance(Microsoft.Azure.PowerShell.Cmdlets.Reso { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.PowerShell.cs index 9f0a9374c682..04664746811b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleInstanceFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleInstanceFilter(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleInstanceFilter(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,25 +116,25 @@ internal RoleEligibilityScheduleInstanceFilter(global::System.Collections.IDicti // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("RoleEligibilityScheduleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -141,19 +149,19 @@ internal RoleEligibilityScheduleInstanceFilter(global::System.Management.Automat // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("RoleEligibilityScheduleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -162,6 +170,18 @@ internal RoleEligibilityScheduleInstanceFilter(global::System.Management.Automat /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule instance filter [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs index 44ab680e41ce..f08f8611b0f6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.cs index 9dad08a2c1e6..003ee4a62f98 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule instance filter public partial class RoleEligibilityScheduleInstanceFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal { /// Backing field for property. @@ -57,6 +57,9 @@ public partial interface IRoleEligibilityScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule instances of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IRoleEligibilityScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule instances of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +81,9 @@ public partial interface IRoleEligibilityScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule instances belonging to a specific role eligibility schedule.", SerializedName = @"roleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +92,9 @@ public partial interface IRoleEligibilityScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule instances of the specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.json.cs index dd94adafb846..f3c80e300387 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleInstanceFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleInstanceFilter(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilityScheduleInstanceFilter(Microsoft.Azure.PowerShell.Cmdlet { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_roleEligibilityScheduleId = If( json?.PropertyT("roleEligibilityScheduleId"), out var __jsonRoleEligibilityScheduleId) ? (string)__jsonRoleEligibilityScheduleId : (string)RoleEligibilityScheduleId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_roleEligibilityScheduleId = If( json?.PropertyT("roleEligibilityScheduleId"), out var __jsonRoleEligibilityScheduleId) ? (string)__jsonRoleEligibilityScheduleId : (string)_roleEligibilityScheduleId;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.PowerShell.cs index af271a785f26..33932ddca2a9 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleInstanceListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleInstanceListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleInstanceListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +116,17 @@ internal RoleEligibilityScheduleInstanceListResult(global::System.Collections.ID // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +141,11 @@ internal RoleEligibilityScheduleInstanceListResult(global::System.Management.Aut // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleEligibilityScheduleInstanceListResult(global::System.Management.Aut /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule instance list operation result. [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs index 46ae33ad7c46..5ca63266b69b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.cs index cd8ef19df277..2f0c266f1548 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule instance list operation result. public partial class RoleEligibilityScheduleInstanceListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleEligibilityScheduleInstanceListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[] _value; + private System.Collections.Generic.List _value; /// Role eligibility schedule instance list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// /// Creates an new instance. @@ -43,6 +43,9 @@ public partial interface IRoleEligibilityScheduleInstanceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -51,10 +54,13 @@ public partial interface IRoleEligibilityScheduleInstanceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role eligibility schedule instance list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance) })] + System.Collections.Generic.List Value { get; set; } } /// Role eligibility schedule instance list operation result. @@ -64,7 +70,7 @@ internal partial interface IRoleEligibilityScheduleInstanceListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role eligibility schedule instance list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.json.cs index fde1e2fafc87..5356afefcba6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleInstanceListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleInstanceListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleEligibilityScheduleInstanceListResult(Microsoft.Azure.PowerShell.Cm { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstance.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.PowerShell.cs new file mode 100644 index 000000000000..9be54306c6de --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.PowerShell.cs @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role eligibility schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstancePropertiesTypeConverter))] + public partial class RoleEligibilityScheduleInstanceProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleInstanceProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleInstanceProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleInstanceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleInstanceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role eligibility schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstancePropertiesTypeConverter))] + public partial interface IRoleEligibilityScheduleInstanceProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs index 65a1bb367145..a1f68e55697f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.cs similarity index 71% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.cs index 041bfb504ad7..205b34db60fd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule properties with scope. public partial class RoleEligibilityScheduleInstanceProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal { /// Backing field for property. @@ -46,49 +46,49 @@ public partial class RoleEligibilityScheduleInstanceProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set => this._expandedProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set => this._expandedProperty = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? _memberType; + private string _memberType; /// Membership type of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => this._memberType; set => this._memberType = value; } + public string MemberType { get => this._memberType; set => this._memberType = value; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Backing field for property. private string _principalId; @@ -98,15 +98,15 @@ public partial class RoleEligibilityScheduleInstanceProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; set => this._principalType = value; } + public string PrincipalType { get => this._principalType; set => this._principalType = value; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } /// Backing field for property. private string _roleDefinitionId; @@ -117,7 +117,7 @@ public partial class RoleEligibilityScheduleInstanceProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Backing field for property. private string _roleEligibilityScheduleId; @@ -135,15 +135,15 @@ public partial class RoleEligibilityScheduleInstanceProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -153,11 +153,11 @@ public partial class RoleEligibilityScheduleInstanceProperties : public global::System.DateTime? StartDateTime { get => this._startDateTime; set => this._startDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role eligibility schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// /// Creates an new instance. @@ -178,6 +178,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -186,6 +189,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +200,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -202,6 +211,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endDateTime of the role eligibility schedule instance", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -210,6 +222,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -218,6 +233,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -226,6 +244,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -234,14 +255,21 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role eligibility schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -250,6 +278,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -258,6 +289,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -266,14 +300,21 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -282,6 +323,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -290,6 +334,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -298,6 +345,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the master role eligibility schedule", SerializedName = @"roleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -306,6 +356,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -314,6 +367,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -322,6 +378,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -330,6 +389,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -338,6 +400,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The startDateTime of the role eligibility schedule instance", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -346,10 +411,14 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role eligibility schedule instance", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } } /// Role eligibility schedule properties with scope. @@ -374,15 +443,16 @@ internal partial interface IRoleEligibilityScheduleInstancePropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Membership type of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal string PrincipalDisplayName { get; set; } /// Email id of the principal @@ -390,7 +460,8 @@ internal partial interface IRoleEligibilityScheduleInstancePropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// The role definition ID. @@ -410,7 +481,8 @@ internal partial interface IRoleEligibilityScheduleInstancePropertiesInternal /// The startDateTime of the role eligibility schedule instance global::System.DateTime? StartDateTime { get; set; } /// The status of the role eligibility schedule instance - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.json.cs index daf6fec9f290..dc297ac6819f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleInstanceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleInstanceProperties(json) : null; } @@ -77,19 +77,19 @@ internal RoleEligibilityScheduleInstanceProperties(Microsoft.Azure.PowerShell.Cm { return; } - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_roleEligibilityScheduleId = If( json?.PropertyT("roleEligibilityScheduleId"), out var __jsonRoleEligibilityScheduleId) ? (string)__jsonRoleEligibilityScheduleId : (string)RoleEligibilityScheduleId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)MemberType;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_roleEligibilityScheduleId = If( json?.PropertyT("roleEligibilityScheduleId"), out var __jsonRoleEligibilityScheduleId) ? (string)__jsonRoleEligibilityScheduleId : (string)_roleEligibilityScheduleId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)_memberType;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.PowerShell.cs index 14792417bfc4..1184fa7a0f30 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleListResult(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,17 +115,17 @@ internal RoleEligibilityScheduleListResult(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,11 +140,11 @@ internal RoleEligibilityScheduleListResult(global::System.Management.Automation. // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,6 +153,18 @@ internal RoleEligibilityScheduleListResult(global::System.Management.Automation. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// role eligibility schedule list operation result. [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.TypeConverter.cs index 70ee95d26c25..26d52aeee6e8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.cs index 324933066e7e..6ade6d65fbf0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// role eligibility schedule list operation result. public partial class RoleEligibilityScheduleListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleEligibilityScheduleListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[] _value; + private System.Collections.Generic.List _value; /// role eligibility schedule list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public RoleEligibilityScheduleListResult() @@ -41,6 +41,9 @@ public partial interface IRoleEligibilityScheduleListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IRoleEligibilityScheduleListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"role eligibility schedule list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule) })] + System.Collections.Generic.List Value { get; set; } } /// role eligibility schedule list operation result. @@ -62,7 +68,7 @@ internal partial interface IRoleEligibilityScheduleListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// role eligibility schedule list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.json.cs index 758f38be1c60..db3380ba072c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleEligibilityScheduleListResult(Microsoft.Azure.PowerShell.Cmdlets.Re { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedule.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.PowerShell.cs new file mode 100644 index 000000000000..9a74cb923fb7 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.PowerShell.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role eligibility schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilitySchedulePropertiesTypeConverter))] + public partial class RoleEligibilityScheduleProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleRequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId = (string) content.GetValueForProperty("RoleEligibilityScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleRequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId = (string) content.GetValueForProperty("RoleEligibilityScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role eligibility schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilitySchedulePropertiesTypeConverter))] + public partial interface IRoleEligibilityScheduleProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.TypeConverter.cs index ff73692bdfa2..f45a2d429114 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.cs similarity index 72% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.cs index 52fa810eff07..e7dbdbd0a7cf 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule properties with scope. public partial class RoleEligibilityScheduleProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal { /// Backing field for property. @@ -46,49 +46,49 @@ public partial class RoleEligibilityScheduleProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set => this._expandedProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set => this._expandedProperty = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? _memberType; + private string _memberType; /// Membership type of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => this._memberType; set => this._memberType = value; } + public string MemberType { get => this._memberType; set => this._memberType = value; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Backing field for property. private string _principalId; @@ -98,15 +98,15 @@ public partial class RoleEligibilityScheduleProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; set => this._principalType = value; } + public string PrincipalType { get => this._principalType; set => this._principalType = value; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } /// Backing field for property. private string _roleDefinitionId; @@ -117,7 +117,7 @@ public partial class RoleEligibilityScheduleProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Backing field for property. private string _roleEligibilityScheduleRequestId; @@ -137,15 +137,15 @@ public partial class RoleEligibilityScheduleProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -155,11 +155,11 @@ public partial class RoleEligibilityScheduleProperties : public global::System.DateTime? StartDateTime { get => this._startDateTime; set => this._startDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Backing field for property. private global::System.DateTime? _updatedOn; @@ -185,6 +185,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -193,6 +196,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -201,6 +207,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -209,6 +218,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime when role eligibility schedule", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -217,6 +229,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -225,6 +240,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -233,6 +251,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -241,14 +262,21 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role eligibility schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -257,6 +285,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -265,6 +296,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -273,14 +307,21 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -289,6 +330,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -297,6 +341,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -307,6 +354,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule", SerializedName = @"roleEligibilityScheduleRequestId", PossibleTypes = new [] { typeof(string) })] @@ -315,6 +365,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -323,6 +376,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -331,6 +387,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -339,6 +398,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -347,6 +409,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime when role eligibility schedule", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -355,14 +420,21 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role eligibility schedule.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// DateTime when role eligibility schedule was modified [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was modified", SerializedName = @"updatedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -391,15 +463,16 @@ internal partial interface IRoleEligibilitySchedulePropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Membership type of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal string PrincipalDisplayName { get; set; } /// Email id of the principal @@ -407,7 +480,8 @@ internal partial interface IRoleEligibilitySchedulePropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// The role definition ID. @@ -429,7 +503,8 @@ internal partial interface IRoleEligibilitySchedulePropertiesInternal /// Start DateTime when role eligibility schedule global::System.DateTime? StartDateTime { get; set; } /// The status of the role eligibility schedule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// DateTime when role eligibility schedule was modified global::System.DateTime? UpdatedOn { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.json.cs index 7d8cb03e0138..d28189791aaf 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleProperties(json) : null; } @@ -77,20 +77,20 @@ internal RoleEligibilityScheduleProperties(Microsoft.Azure.PowerShell.Cmdlets.Re { return; } - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_roleEligibilityScheduleRequestId = If( json?.PropertyT("roleEligibilityScheduleRequestId"), out var __jsonRoleEligibilityScheduleRequestId) ? (string)__jsonRoleEligibilityScheduleRequestId : (string)RoleEligibilityScheduleRequestId;} - {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)MemberType;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} - {_updatedOn = If( json?.PropertyT("updatedOn"), out var __jsonUpdatedOn) ? global::System.DateTime.TryParse((string)__jsonUpdatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedOnValue) ? __jsonUpdatedOnValue : UpdatedOn : UpdatedOn;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_roleEligibilityScheduleRequestId = If( json?.PropertyT("roleEligibilityScheduleRequestId"), out var __jsonRoleEligibilityScheduleRequestId) ? (string)__jsonRoleEligibilityScheduleRequestId : (string)_roleEligibilityScheduleRequestId;} + {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)_memberType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} + {_updatedOn = If( json?.PropertyT("updatedOn"), out var __jsonUpdatedOn) ? global::System.DateTime.TryParse((string)__jsonUpdatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedOnValue) ? __jsonUpdatedOnValue : _updatedOn : _updatedOn;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.PowerShell.cs new file mode 100644 index 000000000000..3c055db6dc2d --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.PowerShell.cs @@ -0,0 +1,486 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role Eligibility schedule request + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestTypeConverter))] + public partial class RoleEligibilityScheduleRequest + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration, 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 RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration, 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.Resources.Authorization.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(); + } + } + /// Role Eligibility schedule request + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestTypeConverter))] + public partial interface IRoleEligibilityScheduleRequest + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.TypeConverter.cs index c9a7dfe548a8..4cf95f8c5299 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.cs index 573a211419ca..692cf6ca3627 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.cs @@ -3,20 +3,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role Eligibility schedule request public partial class RoleEligibilityScheduleRequest : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal { /// The approvalId of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId; } + public string ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] @@ -24,47 +24,47 @@ public partial class RoleEligibilityScheduleRequest : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role eligibility schedule request was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn; } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn; } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationDuration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationDuration = value ?? null; } /// End DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime = value ?? default(global::System.DateTime); } /// Type of the role eligibility schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationType = value ?? null; } /// Backing field for property. private string _id; @@ -77,58 +77,88 @@ public partial class RoleEligibilityScheduleRequest : /// Justification for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Justification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Justification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Justification = value ?? null; } + public string Justification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Justification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Justification = value ?? null; } /// Internal Acessors for ApprovalId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId = value ?? null; } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExpandedPropertiesPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesPrincipalType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PrincipalDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + + /// Internal Acessors for PrincipalEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail = value ?? null; } /// Internal Acessors for PrincipalType - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties()); set { {_property = value;} } } /// Internal Acessors for RequestorId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId = value ?? null; } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// Internal Acessors for ScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ScheduleInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScheduleInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfo = value ?? null /* model class */; } /// Internal Acessors for ScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope = value ?? null; } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType = value ?? null; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status = value ?? null; } /// Internal Acessors for TicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.TicketInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.TicketInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfo = value ?? null /* model class */; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -141,42 +171,42 @@ public partial class RoleEligibilityScheduleRequest : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType; } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties _property; /// Role eligibility schedule request properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties()); set => this._property = value; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType)""); } + public string RequestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestType = value ?? null; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId; } + public string RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -186,69 +216,69 @@ public partial class RoleEligibilityScheduleRequest : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime = value ?? default(global::System.DateTime); } /// The role eligibility schedule request scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType; } /// The status of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TargetRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleId = value ?? null; } + public string TargetRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleId = value ?? null; } /// The role eligibility schedule instance id being updated [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TargetRoleEligibilityScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleInstanceId = value ?? null; } + public string TargetRoleEligibilityScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleInstanceId = value ?? null; } /// Ticket number for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber = value ?? null; } + public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber = value ?? null; } /// Ticket system name for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem = value ?? null; } + public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem = value ?? null; } /// Backing field for property. private string _type; @@ -272,6 +302,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The approvalId of the role eligibility schedule request.", SerializedName = @"approvalId", PossibleTypes = new [] { typeof(string) })] @@ -283,6 +316,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -291,6 +327,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -299,6 +338,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime when role eligibility schedule request was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -306,31 +348,43 @@ public partial interface IRoleEligibilityScheduleRequest : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalId { get; set; } + string ExpandedPropertiesPrincipalId { get; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalType { get; set; } + string ExpandedPropertiesPrincipalType { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesRoleDefinitionId { get; set; } + string ExpandedPropertiesRoleDefinitionId { get; } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role eligibility schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -339,6 +393,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role eligibility schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -347,14 +404,21 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// The role eligibility schedule request ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -363,6 +427,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Justification for the role eligibility", SerializedName = @"justification", PossibleTypes = new [] { typeof(string) })] @@ -371,6 +438,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -378,23 +448,32 @@ public partial interface IRoleEligibilityScheduleRequest : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string PrincipalDisplayName { get; set; } + string PrincipalDisplayName { get; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string PrincipalEmail { get; set; } + string PrincipalEmail { get; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -403,24 +482,35 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the user who created this request", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -428,15 +518,21 @@ public partial interface IRoleEligibilityScheduleRequest : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -444,15 +540,21 @@ public partial interface IRoleEligibilityScheduleRequest : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role eligibility schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -461,6 +563,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -468,41 +573,57 @@ public partial interface IRoleEligibilityScheduleRequest : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The status of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the role eligibility schedule request.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resultant role eligibility schedule id or the role eligibility schedule id being updated", SerializedName = @"targetRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -511,6 +632,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule instance id being updated", SerializedName = @"targetRoleEligibilityScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -519,6 +643,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role eligibility", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -527,6 +654,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role eligibility", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] @@ -535,6 +665,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -563,19 +696,20 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Duration of the role eligibility schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role eligibility schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role eligibility schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// The role eligibility schedule request ID. string Id { get; set; } /// Justification for the role eligibility @@ -589,13 +723,15 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role eligibility schedule request properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties Property { get; set; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request string RequestorId { get; set; } /// Display name of the role definition @@ -605,9 +741,9 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Schedule info of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } /// Expiration of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } /// Start DateTime of the role eligibility schedule. global::System.DateTime? ScheduleInfoStartDateTime { get; set; } /// The role eligibility schedule request scope. @@ -619,7 +755,8 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// Type of the resource string ScopeType { get; set; } /// The status of the role eligibility schedule request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// @@ -627,7 +764,7 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// The role eligibility schedule instance id being updated string TargetRoleEligibilityScheduleInstanceId { get; set; } /// Ticket Info of the role eligibility - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } /// Ticket number for the role eligibility string TicketInfoTicketNumber { get; set; } /// Ticket system name for the role eligibility diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.json.cs index 875d826093dd..214249210fcc 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequest(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilityScheduleRequest(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.PowerShell.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.PowerShell.cs index 78c3928a27a9..de2bb803970c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestFilter(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestFilter(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,25 +115,25 @@ internal RoleEligibilityScheduleRequestFilter(global::System.Collections.IDictio // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("RequestorId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -140,19 +148,19 @@ internal RoleEligibilityScheduleRequestFilter(global::System.Management.Automati // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("RequestorId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -161,6 +169,18 @@ internal RoleEligibilityScheduleRequestFilter(global::System.Management.Automati /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule request filter [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.TypeConverter.cs index d11bffe5453b..a9b1ee5afc52 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.cs index 0e233fd31674..490d46e7fd15 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule request filter public partial class RoleEligibilityScheduleRequestFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IRoleEligibilityScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility requests of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IRoleEligibilityScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility requests created by specific principal.", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IRoleEligibilityScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility requests of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IRoleEligibilityScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility requests of specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.json.cs index 4815a5e9512a..0d4877dfc305 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestFilter(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilityScheduleRequestFilter(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)RequestorId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)_requestorId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.PowerShell.cs index a2d4da18f4cb..1dc403d1b755 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +116,17 @@ internal RoleEligibilityScheduleRequestListResult(global::System.Collections.IDi // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +141,11 @@ internal RoleEligibilityScheduleRequestListResult(global::System.Management.Auto // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleEligibilityScheduleRequestListResult(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule request list operation result. [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.TypeConverter.cs index 6e46e031ab62..7aff1a61333a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.cs index dae9403bd257..5f043abda849 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule request list operation result. public partial class RoleEligibilityScheduleRequestListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleEligibilityScheduleRequestListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[] _value; + private System.Collections.Generic.List _value; /// Role eligibility schedule request list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// /// Creates an new instance. @@ -43,6 +43,9 @@ public partial interface IRoleEligibilityScheduleRequestListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -51,10 +54,13 @@ public partial interface IRoleEligibilityScheduleRequestListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role eligibility schedule request list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest) })] + System.Collections.Generic.List Value { get; set; } } /// Role eligibility schedule request list operation result. @@ -64,7 +70,7 @@ internal partial interface IRoleEligibilityScheduleRequestListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role eligibility schedule request list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.json.cs index a9db06adb783..304d96a60697 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleEligibilityScheduleRequestListResult(Microsoft.Azure.PowerShell.Cmd { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.PowerShell.cs new file mode 100644 index 000000000000..429d3f6de344 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.PowerShell.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role eligibility schedule request properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTypeConverter))] + public partial class RoleEligibilityScheduleRequestProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleRequestProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleRequestProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleRequestProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration, 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 RoleEligibilityScheduleRequestProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration, 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.Resources.Authorization.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(); + } + } + /// Role eligibility schedule request properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTypeConverter))] + public partial interface IRoleEligibilityScheduleRequestProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.TypeConverter.cs index 861bad560533..5c98052b9771 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.cs similarity index 61% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.cs index 6f1e6fef6bb5..c251a7946b1d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule request properties with scope. public partial class RoleEligibilityScheduleRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal { /// Backing field for property. @@ -46,34 +46,34 @@ public partial class RoleEligibilityScheduleRequestProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration = value ?? null; } /// End DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime = value ?? default(global::System.DateTime); } /// Type of the role eligibility schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType = value ?? null; } /// Backing field for property. private string _justification; @@ -83,51 +83,81 @@ public partial class RoleEligibilityScheduleRequestProperties : public string Justification { get => this._justification; set => this._justification = value; } /// Internal Acessors for ApprovalId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ApprovalId { get => this._approvalId; set { {_approvalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ApprovalId { get => this._approvalId; set { {_approvalId = value;} } } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + + /// Internal Acessors for ExpandedPropertiesPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesPrincipalType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } + + /// Internal Acessors for PrincipalDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + + /// Internal Acessors for PrincipalEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Internal Acessors for PrincipalType - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.PrincipalType { get => this._principalType; set { {_principalType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.PrincipalType { get => this._principalType; set { {_principalType = value;} } } /// Internal Acessors for RequestorId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.RequestorId { get => this._requestorId; set { {_requestorId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.RequestorId { get => this._requestorId; set { {_requestorId = value;} } } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Internal Acessors for ScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo()); set { {_scheduleInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo()); set { {_scheduleInfo = value;} } } /// Internal Acessors for ScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Internal Acessors for TicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo()); set { {_ticketInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo()); set { {_ticketInfo = value;} } } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; } /// Backing field for property. private string _principalId; @@ -137,20 +167,20 @@ public partial class RoleEligibilityScheduleRequestProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; } + public string PrincipalType { get => this._principalType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType _requestType; + private string _requestType; /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get => this._requestType; set => this._requestType = value; } + public string RequestType { get => this._requestType; set => this._requestType = value; } /// Backing field for property. private string _requestorId; @@ -161,7 +191,7 @@ public partial class RoleEligibilityScheduleRequestProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; } /// Backing field for property. private string _roleDefinitionId; @@ -172,18 +202,18 @@ public partial class RoleEligibilityScheduleRequestProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo _scheduleInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo _scheduleInfo; /// Schedule info of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo()); set => this._scheduleInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo()); set => this._scheduleInfo = value; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime = value ?? default(global::System.DateTime); } /// Backing field for property. private string _scope; @@ -194,22 +224,22 @@ public partial class RoleEligibilityScheduleRequestProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; } + public string Status { get => this._status; } /// Backing field for property. private string _targetRoleEligibilityScheduleId; @@ -230,19 +260,19 @@ public partial class RoleEligibilityScheduleRequestProperties : public string TargetRoleEligibilityScheduleInstanceId { get => this._targetRoleEligibilityScheduleInstanceId; set => this._targetRoleEligibilityScheduleInstanceId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo _ticketInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo _ticketInfo; /// Ticket Info of the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo()); set => this._ticketInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo()); set => this._ticketInfo = value; } /// Ticket number for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber = value ?? null; } + public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber = value ?? null; } /// Ticket system name for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem = value ?? null; } + public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem = value ?? null; } /// /// Creates an new instance. @@ -260,6 +290,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The approvalId of the role eligibility schedule request.", SerializedName = @"approvalId", PossibleTypes = new [] { typeof(string) })] @@ -271,6 +304,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -279,6 +315,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -287,6 +326,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime when role eligibility schedule request was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -294,31 +336,43 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalId { get; set; } + string ExpandedPropertiesPrincipalId { get; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalType { get; set; } + string ExpandedPropertiesPrincipalType { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesRoleDefinitionId { get; set; } + string ExpandedPropertiesRoleDefinitionId { get; } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role eligibility schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -327,6 +381,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role eligibility schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -335,14 +392,21 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Justification for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Justification for the role eligibility", SerializedName = @"justification", PossibleTypes = new [] { typeof(string) })] @@ -350,23 +414,32 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string PrincipalDisplayName { get; set; } + string PrincipalDisplayName { get; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string PrincipalEmail { get; set; } + string PrincipalEmail { get; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -375,24 +448,35 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the user who created this request", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -400,15 +484,21 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -416,15 +506,21 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role eligibility schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -433,6 +529,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -440,41 +539,57 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The status of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the role eligibility schedule request.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resultant role eligibility schedule id or the role eligibility schedule id being updated", SerializedName = @"targetRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -483,6 +598,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule instance id being updated", SerializedName = @"targetRoleEligibilityScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -491,6 +609,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role eligibility", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -499,6 +620,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role eligibility", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] @@ -527,19 +651,20 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Duration of the role eligibility schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role eligibility schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role eligibility schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Justification for the role eligibility string Justification { get; set; } /// Display name of the principal @@ -549,11 +674,13 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request string RequestorId { get; set; } /// Display name of the role definition @@ -563,9 +690,9 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Schedule info of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } /// Expiration of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } /// Start DateTime of the role eligibility schedule. global::System.DateTime? ScheduleInfoStartDateTime { get; set; } /// The role eligibility schedule request scope. @@ -577,7 +704,8 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// Type of the resource string ScopeType { get; set; } /// The status of the role eligibility schedule request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// @@ -585,7 +713,7 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// The role eligibility schedule instance id being updated string TargetRoleEligibilityScheduleInstanceId { get; set; } /// Ticket Info of the role eligibility - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } /// Ticket number for the role eligibility string TicketInfoTicketNumber { get; set; } /// Ticket system name for the role eligibility diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.json.cs similarity index 91% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.json.cs index 4efdf098d4e7..b6188e48d74e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestProperties(json) : null; } @@ -77,23 +77,23 @@ internal RoleEligibilityScheduleRequestProperties(Microsoft.Azure.PowerShell.Cmd { return; } - {_scheduleInfo = If( json?.PropertyT("scheduleInfo"), out var __jsonScheduleInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo.FromJson(__jsonScheduleInfo) : ScheduleInfo;} - {_ticketInfo = If( json?.PropertyT("ticketInfo"), out var __jsonTicketInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo.FromJson(__jsonTicketInfo) : TicketInfo;} - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_requestType = If( json?.PropertyT("requestType"), out var __jsonRequestType) ? (string)__jsonRequestType : (string)RequestType;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_approvalId = If( json?.PropertyT("approvalId"), out var __jsonApprovalId) ? (string)__jsonApprovalId : (string)ApprovalId;} - {_targetRoleEligibilityScheduleId = If( json?.PropertyT("targetRoleEligibilityScheduleId"), out var __jsonTargetRoleEligibilityScheduleId) ? (string)__jsonTargetRoleEligibilityScheduleId : (string)TargetRoleEligibilityScheduleId;} - {_targetRoleEligibilityScheduleInstanceId = If( json?.PropertyT("targetRoleEligibilityScheduleInstanceId"), out var __jsonTargetRoleEligibilityScheduleInstanceId) ? (string)__jsonTargetRoleEligibilityScheduleInstanceId : (string)TargetRoleEligibilityScheduleInstanceId;} - {_justification = If( json?.PropertyT("justification"), out var __jsonJustification) ? (string)__jsonJustification : (string)Justification;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} - {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)RequestorId;} + {_scheduleInfo = If( json?.PropertyT("scheduleInfo"), out var __jsonScheduleInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo.FromJson(__jsonScheduleInfo) : _scheduleInfo;} + {_ticketInfo = If( json?.PropertyT("ticketInfo"), out var __jsonTicketInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo.FromJson(__jsonTicketInfo) : _ticketInfo;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_requestType = If( json?.PropertyT("requestType"), out var __jsonRequestType) ? (string)__jsonRequestType : (string)_requestType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_approvalId = If( json?.PropertyT("approvalId"), out var __jsonApprovalId) ? (string)__jsonApprovalId : (string)_approvalId;} + {_targetRoleEligibilityScheduleId = If( json?.PropertyT("targetRoleEligibilityScheduleId"), out var __jsonTargetRoleEligibilityScheduleId) ? (string)__jsonTargetRoleEligibilityScheduleId : (string)_targetRoleEligibilityScheduleId;} + {_targetRoleEligibilityScheduleInstanceId = If( json?.PropertyT("targetRoleEligibilityScheduleInstanceId"), out var __jsonTargetRoleEligibilityScheduleInstanceId) ? (string)__jsonTargetRoleEligibilityScheduleInstanceId : (string)_targetRoleEligibilityScheduleInstanceId;} + {_justification = If( json?.PropertyT("justification"), out var __jsonJustification) ? (string)__jsonJustification : (string)_justification;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} + {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)_requestorId;} AfterFromJson(json); } @@ -120,26 +120,26 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J } AddIf( null != this._scheduleInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._scheduleInfo.ToJson(null,serializationMode) : null, "scheduleInfo" ,container.Add ); AddIf( null != this._ticketInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._ticketInfo.ToJson(null,serializationMode) : null, "ticketInfo" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._expandedProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._expandedProperty.ToJson(null,serializationMode) : null, "expandedProperties" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); } AddIf( null != (((object)this._roleDefinitionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._roleDefinitionId.ToString()) : null, "roleDefinitionId" ,container.Add ); AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._principalType.ToString()) : null, "principalType" ,container.Add ); } AddIf( null != (((object)this._requestType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._requestType.ToString()) : null, "requestType" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._approvalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._approvalId.ToString()) : null, "approvalId" ,container.Add ); } @@ -148,11 +148,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J AddIf( null != (((object)this._justification)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._justification.ToString()) : null, "justification" ,container.Add ); AddIf( null != (((object)this._condition)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._condition.ToString()) : null, "condition" ,container.Add ); AddIf( null != (((object)this._conditionVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._conditionVersion.ToString()) : null, "conditionVersion" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._createdOn ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._createdOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdOn" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._requestorId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._requestorId.ToString()) : null, "requestorId" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs similarity index 57% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs index 60c641242447..e632775e6d63 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestPropertiesScheduleInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestPropertiesScheduleInfo(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,29 +116,29 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfo(global::System.Col // actually deserialize if (content.Contains("Expiration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); } if (content.Contains("StartDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, global::System.Convert.ToString); } if (content.Contains("ExpirationEndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -145,23 +153,23 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfo(global::System.Man // actually deserialize if (content.Contains("Expiration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); } if (content.Contains("StartDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, global::System.Convert.ToString); } if (content.Contains("ExpirationEndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -170,6 +178,18 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfo(global::System.Man /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Schedule info of the role eligibility schedule [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs index 0b1e186b4284..b1d9e930714c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs index 147ddf4c2257..269007df88b1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs @@ -3,37 +3,37 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Schedule info of the role eligibility schedule public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfo : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration _expiration; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration _expiration; /// Expiration of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration()); set => this._expiration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration()); set => this._expiration = value; } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration = value ?? null; } /// End DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime = value ?? default(global::System.DateTime); } /// Type of the role eligibility schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type = value ?? null; } /// Internal Acessors for Expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal.Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration()); set { {_expiration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal.Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration()); set { {_expiration = value;} } } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -58,6 +58,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role eligibility schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +69,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role eligibility schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -74,14 +80,21 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role eligibility schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -93,13 +106,14 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo { /// Expiration of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Expiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Expiration { get; set; } /// Duration of the role eligibility schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role eligibility schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role eligibility schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Start DateTime of the role eligibility schedule. global::System.DateTime? StartDateTime { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs index 2b61fd770903..673a7dafa7e6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestPropertiesScheduleInfo(json) : null; } @@ -78,8 +78,8 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfo(Microsoft.Azure.Po { return; } - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.FromJson(__jsonExpiration) : Expiration;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.FromJson(__jsonExpiration) : _expiration;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs index b6bb1ceabfcf..de8e64c309d2 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirat partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,21 +116,21 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(global:: // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("EndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Duration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,15 +145,15 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(global:: // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("EndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Duration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,6 +162,18 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(global:: /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Expiration of the role eligibility schedule [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs index 4c75fa70aca8..a01f0b56eb4a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there /// is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs similarity index 82% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs index 4b73b70718b7..7feaa01174b0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Expiration of the role eligibility schedule public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirat public global::System.DateTime? EndDateTime { get => this._endDateTime; set => this._endDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? _type; + private string _type; /// Type of the role eligibility schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// /// Creates an new instance. @@ -50,6 +50,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfoEx [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role eligibility schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -58,6 +61,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfoEx [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role eligibility schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -66,10 +72,14 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfoEx [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string Type { get; set; } } /// Expiration of the role eligibility schedule @@ -81,7 +91,8 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo /// End DateTime of the role eligibility schedule. global::System.DateTime? EndDateTime { get; set; } /// Type of the role eligibility schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs index 38681f14ed47..49fa7def714a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirat partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(json) : null; } @@ -78,9 +78,9 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(Microsof { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? (string)__jsonDuration : (string)Duration;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? (string)__jsonDuration : (string)_duration;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs index 94f4d372631e..d5cc903353b9 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestPropertiesTicketInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestPropertiesTicketInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestPropertiesTicketInfo(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +116,17 @@ internal RoleEligibilityScheduleRequestPropertiesTicketInfo(global::System.Colle // actually deserialize if (content.Contains("TicketNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); } if (content.Contains("TicketSystem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +141,11 @@ internal RoleEligibilityScheduleRequestPropertiesTicketInfo(global::System.Manag // actually deserialize if (content.Contains("TicketNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); } if (content.Contains("TicketSystem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleEligibilityScheduleRequestPropertiesTicketInfo(global::System.Manag /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Ticket Info of the role eligibility [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs index ddef752c170c..ee9de9e022e4 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs index 8fc538e8a93c..443ef682d838 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Ticket Info of the role eligibility public partial class RoleEligibilityScheduleRequestPropertiesTicketInfo : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal { /// Backing field for property. @@ -43,6 +43,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesTicketInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role eligibility", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -51,6 +54,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesTicketInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role eligibility", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs index 7879cff3cfd5..340b788fdbfe 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestPropertiesTicketInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestPropertiesTicketInfo(json) : null; } @@ -78,8 +78,8 @@ internal RoleEligibilityScheduleRequestPropertiesTicketInfo(Microsoft.Azure.Powe { return; } - {_ticketNumber = If( json?.PropertyT("ticketNumber"), out var __jsonTicketNumber) ? (string)__jsonTicketNumber : (string)TicketNumber;} - {_ticketSystem = If( json?.PropertyT("ticketSystem"), out var __jsonTicketSystem) ? (string)__jsonTicketSystem : (string)TicketSystem;} + {_ticketNumber = If( json?.PropertyT("ticketNumber"), out var __jsonTicketNumber) ? (string)__jsonTicketNumber : (string)_ticketNumber;} + {_ticketSystem = If( json?.PropertyT("ticketSystem"), out var __jsonTicketSystem) ? (string)__jsonTicketSystem : (string)_ticketSystem;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.PowerShell.cs new file mode 100644 index 000000000000..0159f84258ef --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.PowerShell.cs @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role management policy + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyTypeConverter))] + public partial class RoleManagementPolicy + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicy(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.Resources.Authorization.Models.IRoleManagementPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicy(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.Resources.Authorization.Models.IRoleManagementPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicy(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.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IsOrganizationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("EffectiveRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).EffectiveRule = (System.Collections.Generic.List) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeType, 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 RoleManagementPolicy(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.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IsOrganizationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("EffectiveRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).EffectiveRule = (System.Collections.Generic.List) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeType, 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.Resources.Authorization.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(); + } + } + /// Role management policy + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyTypeConverter))] + public partial interface IRoleManagementPolicy + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.TypeConverter.cs index 19028eed5639..0553f3217f5a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.cs similarity index 60% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.cs index e6257785738d..687bb2ccad79 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.cs @@ -3,30 +3,30 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy public partial class RoleManagementPolicy : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal { /// The role management policy description. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Description = value ?? null; } /// The role management policy display name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).DisplayName = value ?? null; } /// The readonly computed rule applied to the policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule; } + public System.Collections.Generic.List EffectiveRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule; } /// Backing field for property. private string _id; @@ -39,62 +39,83 @@ public partial class RoleManagementPolicy : /// The role management policy is default policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public bool? IsOrganizationDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).IsOrganizationDefault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).IsOrganizationDefault = value ?? default(bool); } + public bool? IsOrganizationDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).IsOrganizationDefault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).IsOrganizationDefault = value ?? default(bool); } /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? LastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime; } + public global::System.DateTime? LastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime; } /// Internal Acessors for EffectiveRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.EffectiveRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.EffectiveRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule = value ?? null /* arrayOf */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for LastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.LastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedBy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedBy = value ?? null /* model class */; } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType = value ?? null; } /// Internal Acessors for LastModifiedDateTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.LastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime = value ?? default(global::System.DateTime); } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for PolicyProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.PolicyProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).PolicyProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).PolicyProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.PolicyProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).PolicyProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).PolicyProperty = value ?? null /* model class */; } /// Internal Acessors for PolicyPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.PolicyPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).PolicyPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).PolicyPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.PolicyPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).PolicyPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).PolicyPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties()); set { {_property = value;} } } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Scope = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Scope = value ?? null; } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -105,12 +126,12 @@ public partial class RoleManagementPolicy : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties _property; /// Role management policy properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -120,27 +141,27 @@ public partial class RoleManagementPolicy : /// The rule applied to the policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Rule = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Rule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Rule = value ?? null /* arrayOf */; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Scope; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Scope; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeType; } /// Backing field for property. private string _type; @@ -164,6 +185,9 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy description.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +196,9 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy display name.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -180,14 +207,20 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The readonly computed rule applied to the policy.", SerializedName = @"effectiveRules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] + System.Collections.Generic.List EffectiveRule { get; } /// The role management policy Id. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -196,6 +229,9 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy is default policy.", SerializedName = @"isOrganizationDefault", PossibleTypes = new [] { typeof(bool) })] @@ -203,39 +239,54 @@ public partial interface IRoleManagementPolicy : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -244,6 +295,9 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -252,14 +306,20 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The rule applied to the policy.", SerializedName = @"rules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] + System.Collections.Generic.List Rule { get; set; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -267,31 +327,43 @@ public partial interface IRoleManagementPolicy : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The role management policy type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -307,13 +379,13 @@ internal partial interface IRoleManagementPolicyInternal /// The role management policy display name. string DisplayName { get; set; } /// The readonly computed rule applied to the policy. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get; set; } + System.Collections.Generic.List EffectiveRule { get; set; } /// The role management policy Id. string Id { get; set; } /// The role management policy is default policy. bool? IsOrganizationDefault { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get; set; } /// The name of the principal made changes string LastModifiedByDisplayName { get; set; } /// Email of principal @@ -327,13 +399,13 @@ internal partial interface IRoleManagementPolicyInternal /// The role management policy name. string Name { get; set; } /// Additional properties of scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties PolicyProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties PolicyProperty { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope PolicyPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope PolicyPropertyScope { get; set; } /// Role management policy properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties Property { get; set; } /// The rule applied to the policy. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get; set; } + System.Collections.Generic.List Rule { get; set; } /// The role management policy scope. string Scope { get; set; } /// Display name of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.json.cs index 8aaed98f5a85..88219680928f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicy partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicy(json) : null; } @@ -77,10 +77,10 @@ internal RoleManagementPolicy(Microsoft.Azure.PowerShell.Cmdlets.Resources.Autho { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.PowerShell.cs new file mode 100644 index 000000000000..1a87ad9c116d --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.PowerShell.cs @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// The role management policy rule. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyApprovalRuleTypeConverter))] + public partial class RoleManagementPolicyApprovalRule + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyApprovalRule(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.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyApprovalRule(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.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyApprovalRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Setting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetCaller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + } + if (content.Contains("TargetOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + } + if (content.Contains("TargetObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetInheritableSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetEnforcedSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("RuleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); + } + if (content.Contains("SettingApprovalMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode = (string) content.GetValueForProperty("SettingApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode, global::System.Convert.ToString); + } + if (content.Contains("SettingIsApprovalRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired = (bool?) content.GetValueForProperty("SettingIsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingIsApprovalRequiredForExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("SettingIsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingIsRequestorJustificationRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired = (bool?) content.GetValueForProperty("SettingIsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingApprovalStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage = (System.Collections.Generic.List) content.GetValueForProperty("SettingApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStageTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RoleManagementPolicyApprovalRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Setting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetCaller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + } + if (content.Contains("TargetOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + } + if (content.Contains("TargetObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetInheritableSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetEnforcedSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("RuleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); + } + if (content.Contains("SettingApprovalMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode = (string) content.GetValueForProperty("SettingApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode, global::System.Convert.ToString); + } + if (content.Contains("SettingIsApprovalRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired = (bool?) content.GetValueForProperty("SettingIsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingIsApprovalRequiredForExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("SettingIsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingIsRequestorJustificationRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired = (bool?) content.GetValueForProperty("SettingIsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingApprovalStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage = (System.Collections.Generic.List) content.GetValueForProperty("SettingApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStageTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyApprovalRuleTypeConverter))] + public partial interface IRoleManagementPolicyApprovalRule + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.TypeConverter.cs index e8f64c98f235..4dd66cc1edd6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.cs similarity index 56% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.cs index a1b956b19c00..d06e20de432e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.cs @@ -3,92 +3,96 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyApprovalRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } /// Internal Acessors for Setting - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal.Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings()); set { {_setting = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal.Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings()); set { {_setting = value;} } } + + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyApprovalRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyApprovalRule"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings _setting; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings _setting; /// The approval setting [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings()); set => this._setting = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings()); set => this._setting = value; } /// The type of rule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? SettingApprovalMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).ApprovalMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).ApprovalMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode)""); } + public string SettingApprovalMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).ApprovalMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).ApprovalMode = value ?? null; } /// The approval stages of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] SettingApprovalStage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).ApprovalStage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).ApprovalStage = value ?? null /* arrayOf */; } + public System.Collections.Generic.List SettingApprovalStage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).ApprovalStage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).ApprovalStage = value ?? null /* arrayOf */; } /// Determine whether approval is required or not. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public bool? SettingIsApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsApprovalRequired = value ?? default(bool); } + public bool? SettingIsApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsApprovalRequired = value ?? default(bool); } /// Determine whether approval is required for assignment extension. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public bool? SettingIsApprovalRequiredForExtension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsApprovalRequiredForExtension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsApprovalRequiredForExtension = value ?? default(bool); } + public bool? SettingIsApprovalRequiredForExtension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsApprovalRequiredForExtension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsApprovalRequiredForExtension = value ?? default(bool); } /// Determine whether requestor justification required. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public bool? SettingIsRequestorJustificationRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsRequestorJustificationRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsRequestorJustificationRequired = value ?? default(bool); } + public bool? SettingIsRequestorJustificationRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsRequestorJustificationRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsRequestorJustificationRequired = value ?? default(bool); } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyApprovalRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyApprovalRule"; } /// Validates that this object meets the validation criteria. @@ -106,28 +110,38 @@ public RoleManagementPolicyApprovalRule() /// The role management policy rule. public partial interface IRoleManagementPolicyApprovalRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// The type of rule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of rule", SerializedName = @"approvalMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? SettingApprovalMode { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("SingleStage", "Serial", "Parallel", "NoApproval")] + string SettingApprovalMode { get; set; } /// The approval stages of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The approval stages of the request.", SerializedName = @"approvalStages", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] SettingApprovalStage { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage) })] + System.Collections.Generic.List SettingApprovalStage { get; set; } /// Determine whether approval is required or not. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approval is required or not.", SerializedName = @"isApprovalRequired", PossibleTypes = new [] { typeof(bool) })] @@ -136,6 +150,9 @@ public partial interface IRoleManagementPolicyApprovalRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approval is required for assignment extension.", SerializedName = @"isApprovalRequiredForExtension", PossibleTypes = new [] { typeof(bool) })] @@ -144,6 +161,9 @@ public partial interface IRoleManagementPolicyApprovalRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether requestor justification required.", SerializedName = @"isRequestorJustificationRequired", PossibleTypes = new [] { typeof(bool) })] @@ -152,14 +172,15 @@ public partial interface IRoleManagementPolicyApprovalRule : } /// The role management policy rule. internal partial interface IRoleManagementPolicyApprovalRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// The approval setting - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings Setting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings Setting { get; set; } /// The type of rule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? SettingApprovalMode { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("SingleStage", "Serial", "Parallel", "NoApproval")] + string SettingApprovalMode { get; set; } /// The approval stages of the request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] SettingApprovalStage { get; set; } + System.Collections.Generic.List SettingApprovalStage { get; set; } /// Determine whether approval is required or not. bool? SettingIsApprovalRequired { get; set; } /// Determine whether approval is required for assignment extension. diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.json.cs index 781c0b442c00..d709c2f6b3de 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyApprovalRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyApprovalRule(json) : null; } @@ -77,8 +77,8 @@ internal RoleManagementPolicyApprovalRule(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_setting = If( json?.PropertyT("setting"), out var __jsonSetting) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings.FromJson(__jsonSetting) : Setting;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_setting = If( json?.PropertyT("setting"), out var __jsonSetting) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings.FromJson(__jsonSetting) : _setting;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.PowerShell.cs new file mode 100644 index 000000000000..f2b929cc1b35 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.PowerShell.cs @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role management policy + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentTypeConverter))] + public partial class RoleManagementPolicyAssignment + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyAssignment(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.Resources.Authorization.Models.IRoleManagementPolicyAssignment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyAssignment(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.Resources.Authorization.Models.IRoleManagementPolicyAssignment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyAssignment(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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail, 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 RoleManagementPolicyAssignment(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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail, 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.Resources.Authorization.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(); + } + } + /// Role management policy + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentTypeConverter))] + public partial interface IRoleManagementPolicyAssignment + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.TypeConverter.cs index 4941755e8b96..92e00726e171 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.cs similarity index 56% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.cs index d788b7acccd5..0d0aa6125728 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy public partial class RoleManagementPolicyAssignment : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal { /// Backing field for property. @@ -24,52 +24,88 @@ public partial class RoleManagementPolicyAssignment : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PolicyAssignmentPropertiesPolicyId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId = value ?? null; } + + /// Internal Acessors for PolicyAssignmentPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId = value ?? null; } /// Internal Acessors for PolicyAssignmentProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentProperty = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyPolicy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyPolicy = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyScope = value ?? null /* model class */; } /// Internal Acessors for PolicyLastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedBy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedBy = value ?? null /* model class */; } + + /// Internal Acessors for PolicyLastModifiedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime = value ?? default(global::System.DateTime); } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties()); set { {_property = value;} } } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope = value ?? null; } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -82,30 +118,30 @@ public partial class RoleManagementPolicyAssignment : /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId = value ?? null; } + public string PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId = value ?? null; } + public string PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId; } /// The policy id role management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyId = value ?? null; } + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyId = value ?? null; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties _property; /// Role management policy properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -115,37 +151,37 @@ public partial class RoleManagementPolicyAssignment : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName; } /// The role definition of management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType; } /// Backing field for property. private string _type; @@ -169,6 +205,9 @@ public partial interface IRoleManagementPolicyAssignment : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -176,39 +215,54 @@ public partial interface IRoleManagementPolicyAssignment : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// The role management policy name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -216,23 +270,32 @@ public partial interface IRoleManagementPolicyAssignment : /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the policy", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string PolicyAssignmentPropertiesPolicyId { get; set; } + string PolicyAssignmentPropertiesPolicyId { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string PolicyAssignmentPropertiesRoleDefinitionId { get; set; } + string PolicyAssignmentPropertiesRoleDefinitionId { get; } /// The policy id role management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The policy id role management policy assignment.", SerializedName = @"policyId", PossibleTypes = new [] { typeof(string) })] @@ -240,23 +303,32 @@ public partial interface IRoleManagementPolicyAssignment : /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? PolicyLastModifiedDateTime { get; set; } + global::System.DateTime? PolicyLastModifiedDateTime { get; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition of management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition of management policy assignment.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -264,15 +336,21 @@ public partial interface IRoleManagementPolicyAssignment : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -280,31 +358,43 @@ public partial interface IRoleManagementPolicyAssignment : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The role management policy type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -332,21 +422,21 @@ internal partial interface IRoleManagementPolicyAssignmentInternal /// Id of the role definition string PolicyAssignmentPropertiesRoleDefinitionId { get; set; } /// Additional properties of scope, role definition and policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties PolicyAssignmentProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties PolicyAssignmentProperty { get; set; } /// Details of the policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy PolicyAssignmentPropertyPolicy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy PolicyAssignmentPropertyPolicy { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition PolicyAssignmentPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition PolicyAssignmentPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope PolicyAssignmentPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope PolicyAssignmentPropertyScope { get; set; } /// The policy id role management policy assignment. string PolicyId { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal PolicyLastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal PolicyLastModifiedBy { get; set; } /// The last modified date time. global::System.DateTime? PolicyLastModifiedDateTime { get; set; } /// Role management policy properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties Property { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// The role definition of management policy assignment. diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.json.cs index 2af1b4688dc8..5ca03ac4fd6e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyAssignment partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyAssignment(json) : null; } @@ -77,10 +77,10 @@ internal RoleManagementPolicyAssignment(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.PowerShell.cs index dc75049fc2bf..dc589af3886c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyAssignmentListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyAssignmentListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyAssignmentListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,17 +116,17 @@ internal RoleManagementPolicyAssignmentListResult(global::System.Collections.IDi // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,11 +141,11 @@ internal RoleManagementPolicyAssignmentListResult(global::System.Management.Auto // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleManagementPolicyAssignmentListResult(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role management policy assignment list operation result. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.TypeConverter.cs index ff444091d313..54bb45545669 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.cs index 7fd2a1d52e90..765ba259dd39 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy assignment list operation result. public partial class RoleManagementPolicyAssignmentListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleManagementPolicyAssignmentListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[] _value; + private System.Collections.Generic.List _value; /// Role management policy assignment list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// /// Creates an new instance. @@ -43,6 +43,9 @@ public partial interface IRoleManagementPolicyAssignmentListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -51,10 +54,13 @@ public partial interface IRoleManagementPolicyAssignmentListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role management policy assignment list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment) })] + System.Collections.Generic.List Value { get; set; } } /// Role management policy assignment list operation result. @@ -64,7 +70,7 @@ internal partial interface IRoleManagementPolicyAssignmentListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role management policy assignment list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.json.cs index 5590c5035e09..5cb6d775cfd8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyAssignmentListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyAssignmentListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleManagementPolicyAssignmentListResult(Microsoft.Azure.PowerShell.Cmd { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.PowerShell.cs new file mode 100644 index 000000000000..7a1f8cd13f50 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.PowerShell.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role management policy assignment properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentPropertiesTypeConverter))] + public partial class RoleManagementPolicyAssignmentProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyAssignmentProperties(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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyAssignmentProperties(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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyAssignmentProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyAssignmentProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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 RoleManagementPolicyAssignmentProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyAssignmentProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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.Resources.Authorization.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(); + } + } + /// Role management policy assignment properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentPropertiesTypeConverter))] + public partial interface IRoleManagementPolicyAssignmentProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.TypeConverter.cs index 8a372e04e484..33b5a828d3c9 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.cs similarity index 53% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.cs index 2c698600e259..c6f7294adf7a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.cs @@ -3,64 +3,100 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy assignment properties with scope. public partial class RoleManagementPolicyAssignmentProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal { /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType; } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType = value ?? null; } + + /// Internal Acessors for PolicyAssignmentPropertiesPolicyId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId = value ?? null; } + + /// Internal Acessors for PolicyAssignmentPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId = value ?? null; } /// Internal Acessors for PolicyAssignmentProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentProperty { get => (this._policyAssignmentProperty = this._policyAssignmentProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentProperties()); set { {_policyAssignmentProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentProperty { get => (this._policyAssignmentProperty = this._policyAssignmentProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentProperties()); set { {_policyAssignmentProperty = value;} } } /// Internal Acessors for PolicyAssignmentPropertyPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Policy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Policy = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Scope = value ?? null /* model class */; } /// Internal Acessors for PolicyLastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedBy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedBy = value ?? null /* model class */; } + + /// Internal Acessors for PolicyLastModifiedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType = value ?? null; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType = value ?? null; } /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId = value ?? null; } + public string PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId = value ?? null; } + public string PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties _policyAssignmentProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties _policyAssignmentProperty; /// Additional properties of scope, role definition and policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties PolicyAssignmentProperty { get => (this._policyAssignmentProperty = this._policyAssignmentProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties PolicyAssignmentProperty { get => (this._policyAssignmentProperty = this._policyAssignmentProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentProperties()); } /// Backing field for property. private string _policyId; @@ -71,11 +107,11 @@ public partial class RoleManagementPolicyAssignmentProperties : /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName; } /// Backing field for property. private string _roleDefinitionId; @@ -86,7 +122,7 @@ public partial class RoleManagementPolicyAssignmentProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType; } /// Backing field for property. private string _scope; @@ -97,15 +133,15 @@ public partial class RoleManagementPolicyAssignmentProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType; } /// /// Creates an new instance. @@ -122,55 +158,76 @@ public partial interface IRoleManagementPolicyAssignmentProperties : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the policy", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string PolicyAssignmentPropertiesPolicyId { get; set; } + string PolicyAssignmentPropertiesPolicyId { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string PolicyAssignmentPropertiesRoleDefinitionId { get; set; } + string PolicyAssignmentPropertiesRoleDefinitionId { get; } /// The policy id role management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The policy id role management policy assignment.", SerializedName = @"policyId", PossibleTypes = new [] { typeof(string) })] @@ -178,23 +235,32 @@ public partial interface IRoleManagementPolicyAssignmentProperties : /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? PolicyLastModifiedDateTime { get; set; } + global::System.DateTime? PolicyLastModifiedDateTime { get; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition of management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition of management policy assignment.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -202,15 +268,21 @@ public partial interface IRoleManagementPolicyAssignmentProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -218,27 +290,36 @@ public partial interface IRoleManagementPolicyAssignmentProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } } /// Role management policy assignment properties with scope. @@ -258,17 +339,17 @@ internal partial interface IRoleManagementPolicyAssignmentPropertiesInternal /// Id of the role definition string PolicyAssignmentPropertiesRoleDefinitionId { get; set; } /// Additional properties of scope, role definition and policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties PolicyAssignmentProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties PolicyAssignmentProperty { get; set; } /// Details of the policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy PolicyAssignmentPropertyPolicy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy PolicyAssignmentPropertyPolicy { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition PolicyAssignmentPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition PolicyAssignmentPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope PolicyAssignmentPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope PolicyAssignmentPropertyScope { get; set; } /// The policy id role management policy assignment. string PolicyId { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal PolicyLastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal PolicyLastModifiedBy { get; set; } /// The last modified date time. global::System.DateTime? PolicyLastModifiedDateTime { get; set; } /// Display name of the role definition diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.json.cs index 591c50845cb7..8905599f3ceb 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyAssignmentProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyAssignmentProperties(json) : null; } @@ -77,10 +77,10 @@ internal RoleManagementPolicyAssignmentProperties(Microsoft.Azure.PowerShell.Cmd { return; } - {_policyAssignmentProperty = If( json?.PropertyT("policyAssignmentProperties"), out var __jsonPolicyAssignmentProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentProperties.FromJson(__jsonPolicyAssignmentProperties) : PolicyAssignmentProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_policyId = If( json?.PropertyT("policyId"), out var __jsonPolicyId) ? (string)__jsonPolicyId : (string)PolicyId;} + {_policyAssignmentProperty = If( json?.PropertyT("policyAssignmentProperties"), out var __jsonPolicyAssignmentProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentProperties.FromJson(__jsonPolicyAssignmentProperties) : _policyAssignmentProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_policyId = If( json?.PropertyT("policyId"), out var __jsonPolicyId) ? (string)__jsonPolicyId : (string)_policyId;} AfterFromJson(json); } @@ -105,11 +105,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._policyAssignmentProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._policyAssignmentProperty.ToJson(null,serializationMode) : null, "policyAssignmentProperties" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs similarity index 51% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs index 256352c06c7c..daaefbc1fb48 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyAuthenticationContextRule partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyAuthenticationContextRule(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyAuthenticationContextRule(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -108,53 +116,53 @@ internal RoleManagementPolicyAuthenticationContextRule(global::System.Collection // actually deserialize if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ClaimValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue = (string) content.GetValueForProperty("ClaimValue",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue = (string) content.GetValueForProperty("ClaimValue",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -169,47 +177,47 @@ internal RoleManagementPolicyAuthenticationContextRule(global::System.Management // actually deserialize if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ClaimValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue = (string) content.GetValueForProperty("ClaimValue",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue = (string) content.GetValueForProperty("ClaimValue",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -218,6 +226,18 @@ internal RoleManagementPolicyAuthenticationContextRule(global::System.Management /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAuthenticationContextRuleTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs index 4f3d907ec11b..b006a2d9949c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.cs index 195d0d52a176..335f1cf32c4a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyAuthenticationContextRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// Backing field for property. private string _claimValue; @@ -28,7 +28,7 @@ public partial class RoleManagementPolicyAuthenticationContextRule : /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } /// Backing field for property. private bool? _isEnabled; @@ -37,44 +37,48 @@ public partial class RoleManagementPolicyAuthenticationContextRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] public bool? IsEnabled { get => this._isEnabled; set => this._isEnabled = value; } + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyAuthenticationContextRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyAuthenticationContextRule"; } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// /// Creates an new instance. /// public RoleManagementPolicyAuthenticationContextRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyAuthenticationContextRule"; } /// Validates that this object meets the validation criteria. @@ -92,12 +96,15 @@ public RoleManagementPolicyAuthenticationContextRule() /// The role management policy rule. public partial interface IRoleManagementPolicyAuthenticationContextRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// The claim value. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The claim value.", SerializedName = @"claimValue", PossibleTypes = new [] { typeof(string) })] @@ -106,6 +113,9 @@ public partial interface IRoleManagementPolicyAuthenticationContextRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value indicating if rule is enabled.", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -114,7 +124,7 @@ public partial interface IRoleManagementPolicyAuthenticationContextRule : } /// The role management policy rule. internal partial interface IRoleManagementPolicyAuthenticationContextRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// The claim value. string ClaimValue { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.json.cs index 9a8aa608415d..224fe16796b4 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyAuthenticationContextRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyAuthenticationContextRule(json) : null; } @@ -78,9 +78,9 @@ internal RoleManagementPolicyAuthenticationContextRule(Microsoft.Azure.PowerShel { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled;} - {_claimValue = If( json?.PropertyT("claimValue"), out var __jsonClaimValue) ? (string)__jsonClaimValue : (string)ClaimValue;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : _isEnabled;} + {_claimValue = If( json?.PropertyT("claimValue"), out var __jsonClaimValue) ? (string)__jsonClaimValue : (string)_claimValue;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.PowerShell.cs similarity index 52% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.PowerShell.cs index 59bf19567cfa..298f5fb0da19 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyEnablementRule partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyEnablementRule(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyEnablementRule(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,49 +115,49 @@ internal RoleManagementPolicyEnablementRule(global::System.Collections.IDictiona // actually deserialize if (content.Contains("EnabledRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[]) content.GetValueForProperty("EnabledRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules.CreateFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule = (System.Collections.Generic.List) content.GetValueForProperty("EnabledRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -164,43 +172,43 @@ internal RoleManagementPolicyEnablementRule(global::System.Management.Automation // actually deserialize if (content.Contains("EnabledRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[]) content.GetValueForProperty("EnabledRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules.CreateFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule = (System.Collections.Generic.List) content.GetValueForProperty("EnabledRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -209,6 +217,18 @@ internal RoleManagementPolicyEnablementRule(global::System.Management.Automation /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyEnablementRuleTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.TypeConverter.cs index dc8ff88dab99..583e34d8d7e6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.cs similarity index 51% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.cs index dfdaafaff34e..3f7820a3a2ff 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.cs @@ -3,69 +3,73 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyEnablementRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[] _enabledRule; + private System.Collections.Generic.List _enabledRule; /// The list of enabled rules. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[] EnabledRule { get => this._enabledRule; set => this._enabledRule = value; } + public System.Collections.Generic.List EnabledRule { get => this._enabledRule; set => this._enabledRule = value; } /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyEnablementRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyEnablementRule"; } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyEnablementRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyEnablementRule"; } /// Validates that this object meets the validation criteria. @@ -83,24 +87,29 @@ public RoleManagementPolicyEnablementRule() /// The role management policy rule. public partial interface IRoleManagementPolicyEnablementRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// The list of enabled rules. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of enabled rules.", SerializedName = @"enabledRules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[] EnabledRule { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("MultiFactorAuthentication", "Justification", "Ticketing")] + System.Collections.Generic.List EnabledRule { get; set; } } /// The role management policy rule. internal partial interface IRoleManagementPolicyEnablementRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// The list of enabled rules. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[] EnabledRule { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("MultiFactorAuthentication", "Justification", "Ticketing")] + System.Collections.Generic.List EnabledRule { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.json.cs similarity index 88% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.json.cs index 37eba3260404..a2bc812ae63d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyEnablementRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyEnablementRule(json) : null; } @@ -77,8 +77,8 @@ internal RoleManagementPolicyEnablementRule(Microsoft.Azure.PowerShell.Cmdlets.R { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_enabledRule = If( json?.PropertyT("enabledRules"), out var __jsonEnabledRules) ? If( __jsonEnabledRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Support.EnablementRules) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules)""))) ))() : null : EnabledRule;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_enabledRule = If( json?.PropertyT("enabledRules"), out var __jsonEnabledRules) ? If( __jsonEnabledRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _enabledRule;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.PowerShell.cs similarity index 51% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.PowerShell.cs index 8bdcecda392f..d3e45f981a0a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyExpirationRule partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyExpirationRule(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyExpirationRule(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,53 +115,53 @@ internal RoleManagementPolicyExpirationRule(global::System.Collections.IDictiona // actually deserialize if (content.Contains("IsExpirationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired = (bool?) content.GetValueForProperty("IsExpirationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired = (bool?) content.GetValueForProperty("IsExpirationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("MaximumDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration = (string) content.GetValueForProperty("MaximumDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration = (string) content.GetValueForProperty("MaximumDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -168,47 +176,47 @@ internal RoleManagementPolicyExpirationRule(global::System.Management.Automation // actually deserialize if (content.Contains("IsExpirationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired = (bool?) content.GetValueForProperty("IsExpirationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired = (bool?) content.GetValueForProperty("IsExpirationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("MaximumDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration = (string) content.GetValueForProperty("MaximumDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration = (string) content.GetValueForProperty("MaximumDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -217,6 +225,18 @@ internal RoleManagementPolicyExpirationRule(global::System.Management.Automation /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyExpirationRuleTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.TypeConverter.cs index 002f3fc6b6a1..7a5acb0124d3 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.cs similarity index 60% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.cs index 839761cd3b95..b6b12d98ae3a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyExpirationRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } /// Backing field for property. private bool? _isExpirationRequired; @@ -37,42 +37,46 @@ public partial class RoleManagementPolicyExpirationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] public string MaximumDuration { get => this._maximumDuration; set => this._maximumDuration = value; } + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyExpirationRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyExpirationRule"; } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyExpirationRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyExpirationRule"; } /// Validates that this object meets the validation criteria. @@ -90,12 +94,15 @@ public RoleManagementPolicyExpirationRule() /// The role management policy rule. public partial interface IRoleManagementPolicyExpirationRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// The value indicating whether expiration is required. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value indicating whether expiration is required.", SerializedName = @"isExpirationRequired", PossibleTypes = new [] { typeof(bool) })] @@ -104,6 +111,9 @@ public partial interface IRoleManagementPolicyExpirationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The maximum duration of expiration in timespan.", SerializedName = @"maximumDuration", PossibleTypes = new [] { typeof(string) })] @@ -112,7 +122,7 @@ public partial interface IRoleManagementPolicyExpirationRule : } /// The role management policy rule. internal partial interface IRoleManagementPolicyExpirationRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// The value indicating whether expiration is required. bool? IsExpirationRequired { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.json.cs index 3c8394179f83..e56facf36907 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyExpirationRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyExpirationRule(json) : null; } @@ -77,9 +77,9 @@ internal RoleManagementPolicyExpirationRule(Microsoft.Azure.PowerShell.Cmdlets.R { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_isExpirationRequired = If( json?.PropertyT("isExpirationRequired"), out var __jsonIsExpirationRequired) ? (bool?)__jsonIsExpirationRequired : IsExpirationRequired;} - {_maximumDuration = If( json?.PropertyT("maximumDuration"), out var __jsonMaximumDuration) ? (string)__jsonMaximumDuration : (string)MaximumDuration;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_isExpirationRequired = If( json?.PropertyT("isExpirationRequired"), out var __jsonIsExpirationRequired) ? (bool?)__jsonIsExpirationRequired : _isExpirationRequired;} + {_maximumDuration = If( json?.PropertyT("maximumDuration"), out var __jsonMaximumDuration) ? (string)__jsonMaximumDuration : (string)_maximumDuration;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.PowerShell.cs similarity index 68% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.PowerShell.cs index 50fcd818876b..d55bcb6fe721 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyListResult(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,17 +113,17 @@ internal RoleManagementPolicyListResult(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -130,11 +138,11 @@ internal RoleManagementPolicyListResult(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +151,18 @@ internal RoleManagementPolicyListResult(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role management policy list operation result. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.TypeConverter.cs index 841c7aaca3c2..7f73c71f2bf6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.cs index c7ea3dcf2f0f..4d20aca7ed26 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy list operation result. public partial class RoleManagementPolicyListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleManagementPolicyListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[] _value; + private System.Collections.Generic.List _value; /// Role management policy list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public RoleManagementPolicyListResult() @@ -41,6 +41,9 @@ public partial interface IRoleManagementPolicyListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IRoleManagementPolicyListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role management policy list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy) })] + System.Collections.Generic.List Value { get; set; } } /// Role management policy list operation result. @@ -62,7 +68,7 @@ internal partial interface IRoleManagementPolicyListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role management policy list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.json.cs index 3e80c59c86dd..523ad1c696f1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleManagementPolicyListResult(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.PowerShell.cs new file mode 100644 index 000000000000..3cfc1618a0a7 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.PowerShell.cs @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// The role management policy rule. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyNotificationRuleTypeConverter))] + public partial class RoleManagementPolicyNotificationRule + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyNotificationRule(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.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyNotificationRule(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.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyNotificationRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NotificationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType = (string) content.GetValueForProperty("NotificationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType, global::System.Convert.ToString); + } + if (content.Contains("NotificationLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel = (string) content.GetValueForProperty("NotificationLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel, global::System.Convert.ToString); + } + if (content.Contains("RecipientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType = (string) content.GetValueForProperty("RecipientType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType, global::System.Convert.ToString); + } + if (content.Contains("NotificationRecipient")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient = (System.Collections.Generic.List) content.GetValueForProperty("NotificationRecipient",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("IsDefaultRecipientsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled = (bool?) content.GetValueForProperty("IsDefaultRecipientsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetCaller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + } + if (content.Contains("TargetOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + } + if (content.Contains("TargetObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetInheritableSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetEnforcedSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("RuleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, 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 RoleManagementPolicyNotificationRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NotificationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType = (string) content.GetValueForProperty("NotificationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType, global::System.Convert.ToString); + } + if (content.Contains("NotificationLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel = (string) content.GetValueForProperty("NotificationLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel, global::System.Convert.ToString); + } + if (content.Contains("RecipientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType = (string) content.GetValueForProperty("RecipientType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType, global::System.Convert.ToString); + } + if (content.Contains("NotificationRecipient")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient = (System.Collections.Generic.List) content.GetValueForProperty("NotificationRecipient",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("IsDefaultRecipientsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled = (bool?) content.GetValueForProperty("IsDefaultRecipientsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetCaller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + } + if (content.Contains("TargetOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + } + if (content.Contains("TargetObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetInheritableSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetEnforcedSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("RuleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, 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.Resources.Authorization.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 role management policy rule. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyNotificationRuleTypeConverter))] + public partial interface IRoleManagementPolicyNotificationRule + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.TypeConverter.cs index 3ea66307ed01..0d29b53910c8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.cs similarity index 56% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.cs index 1186d61f7254..9c3259d57191 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyNotificationRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } /// Backing field for property. private bool? _isDefaultRecipientsEnabled; @@ -32,70 +32,74 @@ public partial class RoleManagementPolicyNotificationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] public bool? IsDefaultRecipientsEnabled { get => this._isDefaultRecipientsEnabled; set => this._isDefaultRecipientsEnabled = value; } + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel? _notificationLevel; + private string _notificationLevel; /// The notification level. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel? NotificationLevel { get => this._notificationLevel; set => this._notificationLevel = value; } + public string NotificationLevel { get => this._notificationLevel; set => this._notificationLevel = value; } /// Backing field for property. - private string[] _notificationRecipient; + private System.Collections.Generic.List _notificationRecipient; /// The list notification recipients. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] NotificationRecipient { get => this._notificationRecipient; set => this._notificationRecipient = value; } + public System.Collections.Generic.List NotificationRecipient { get => this._notificationRecipient; set => this._notificationRecipient = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism? _notificationType; + private string _notificationType; /// The type of notification. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism? NotificationType { get => this._notificationType; set => this._notificationType = value; } + public string NotificationType { get => this._notificationType; set => this._notificationType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType? _recipientType; + private string _recipientType; /// The recipient type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType? RecipientType { get => this._recipientType; set => this._recipientType = value; } + public string RecipientType { get => this._recipientType; set => this._recipientType = value; } /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyNotificationRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyNotificationRule"; } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyNotificationRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyNotificationRule"; } /// Validates that this object meets the validation criteria. @@ -113,7 +117,7 @@ public RoleManagementPolicyNotificationRule() /// The role management policy rule. public partial interface IRoleManagementPolicyNotificationRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// /// Its value determine if the notification need to be sent to the recipient type specified in policy rule. @@ -121,6 +125,9 @@ public partial interface IRoleManagementPolicyNotificationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Its value determine if the notification need to be sent to the recipient type specified in policy rule.", SerializedName = @"isDefaultRecipientsEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -129,52 +136,70 @@ public partial interface IRoleManagementPolicyNotificationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The notification level.", SerializedName = @"notificationLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel? NotificationLevel { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("None", "Critical", "All")] + string NotificationLevel { get; set; } /// The list notification recipients. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list notification recipients.", SerializedName = @"notificationRecipients", PossibleTypes = new [] { typeof(string) })] - string[] NotificationRecipient { get; set; } + System.Collections.Generic.List NotificationRecipient { get; set; } /// The type of notification. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of notification.", SerializedName = @"notificationType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism? NotificationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Email")] + string NotificationType { get; set; } /// The recipient type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The recipient type.", SerializedName = @"recipientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType? RecipientType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Requestor", "Approver", "Admin")] + string RecipientType { get; set; } } /// The role management policy rule. internal partial interface IRoleManagementPolicyNotificationRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// /// Its value determine if the notification need to be sent to the recipient type specified in policy rule. /// bool? IsDefaultRecipientsEnabled { get; set; } /// The notification level. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel? NotificationLevel { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("None", "Critical", "All")] + string NotificationLevel { get; set; } /// The list notification recipients. - string[] NotificationRecipient { get; set; } + System.Collections.Generic.List NotificationRecipient { get; set; } /// The type of notification. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism? NotificationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Email")] + string NotificationType { get; set; } /// The recipient type. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType? RecipientType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Requestor", "Approver", "Admin")] + string RecipientType { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.json.cs similarity index 90% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.json.cs index dde409f2d659..95ab416f7515 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyNotificationRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyNotificationRule(json) : null; } @@ -77,12 +77,12 @@ internal RoleManagementPolicyNotificationRule(Microsoft.Azure.PowerShell.Cmdlets { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_notificationType = If( json?.PropertyT("notificationType"), out var __jsonNotificationType) ? (string)__jsonNotificationType : (string)NotificationType;} - {_notificationLevel = If( json?.PropertyT("notificationLevel"), out var __jsonNotificationLevel) ? (string)__jsonNotificationLevel : (string)NotificationLevel;} - {_recipientType = If( json?.PropertyT("recipientType"), out var __jsonRecipientType) ? (string)__jsonRecipientType : (string)RecipientType;} - {_notificationRecipient = If( json?.PropertyT("notificationRecipients"), out var __jsonNotificationRecipients) ? If( __jsonNotificationRecipients as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : NotificationRecipient;} - {_isDefaultRecipientsEnabled = If( json?.PropertyT("isDefaultRecipientsEnabled"), out var __jsonIsDefaultRecipientsEnabled) ? (bool?)__jsonIsDefaultRecipientsEnabled : IsDefaultRecipientsEnabled;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_notificationType = If( json?.PropertyT("notificationType"), out var __jsonNotificationType) ? (string)__jsonNotificationType : (string)_notificationType;} + {_notificationLevel = If( json?.PropertyT("notificationLevel"), out var __jsonNotificationLevel) ? (string)__jsonNotificationLevel : (string)_notificationLevel;} + {_recipientType = If( json?.PropertyT("recipientType"), out var __jsonRecipientType) ? (string)__jsonRecipientType : (string)_recipientType;} + {_notificationRecipient = If( json?.PropertyT("notificationRecipients"), out var __jsonNotificationRecipients) ? If( __jsonNotificationRecipients as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _notificationRecipient;} + {_isDefaultRecipientsEnabled = If( json?.PropertyT("isDefaultRecipientsEnabled"), out var __jsonIsDefaultRecipientsEnabled) ? (bool?)__jsonIsDefaultRecipientsEnabled : _isDefaultRecipientsEnabled;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..456b64e3b0af --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.PowerShell.cs @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role management policy properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyPropertiesTypeConverter))] + public partial class RoleManagementPolicyProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyProperties(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.Resources.Authorization.Models.IRoleManagementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyProperties(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.Resources.Authorization.Models.IRoleManagementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IsOrganizationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("EffectiveRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule = (System.Collections.Generic.List) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeType, 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 RoleManagementPolicyProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IsOrganizationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("EffectiveRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule = (System.Collections.Generic.List) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeType, 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.Resources.Authorization.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(); + } + } + /// Role management policy properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyPropertiesTypeConverter))] + public partial interface IRoleManagementPolicyProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.TypeConverter.cs index 9d6fb2cec7b3..b6c642ce8624 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.cs similarity index 61% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.cs index 92cacb61a6b2..c5118275b263 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy properties with scope. public partial class RoleManagementPolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class RoleManagementPolicyProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] _effectiveRule; + private System.Collections.Generic.List _effectiveRule; /// The readonly computed rule applied to the policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get => this._effectiveRule; } + public System.Collections.Generic.List EffectiveRule { get => this._effectiveRule; } /// Backing field for property. private bool? _isOrganizationDefault; @@ -42,27 +42,27 @@ public partial class RoleManagementPolicyProperties : public bool? IsOrganizationDefault { get => this._isOrganizationDefault; set => this._isOrganizationDefault = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal _lastModifiedBy; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal _lastModifiedBy; /// The name of the entity last modified it [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal()); } /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).DisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Email = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Id = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Type = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type; } /// Backing field for property. private global::System.DateTime? _lastModifiedDateTime; @@ -72,36 +72,57 @@ public partial class RoleManagementPolicyProperties : public global::System.DateTime? LastModifiedDateTime { get => this._lastModifiedDateTime; } /// Internal Acessors for EffectiveRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.EffectiveRule { get => this._effectiveRule; set { {_effectiveRule = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.EffectiveRule { get => this._effectiveRule; set { {_effectiveRule = value;} } } /// Internal Acessors for LastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal()); set { {_lastModifiedBy = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal()); set { {_lastModifiedBy = value;} } } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type = value ?? null; } /// Internal Acessors for LastModifiedDateTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.LastModifiedDateTime { get => this._lastModifiedDateTime; set { {_lastModifiedDateTime = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedDateTime { get => this._lastModifiedDateTime; set { {_lastModifiedDateTime = value;} } } /// Internal Acessors for PolicyProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.PolicyProperty { get => (this._policyProperty = this._policyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyProperties()); set { {_policyProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.PolicyProperty { get => (this._policyProperty = this._policyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyProperties()); set { {_policyProperty = value;} } } /// Internal Acessors for PolicyPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.PolicyPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.PolicyPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).Scope = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties _policyProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties _policyProperty; /// Additional properties of scope [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties PolicyProperty { get => (this._policyProperty = this._policyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties PolicyProperty { get => (this._policyProperty = this._policyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyProperties()); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] _rule; + private System.Collections.Generic.List _rule; /// The rule applied to the policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get => this._rule; set => this._rule = value; } + public System.Collections.Generic.List Rule { get => this._rule; set => this._rule = value; } /// Backing field for property. private string _scope; @@ -112,15 +133,15 @@ public partial class RoleManagementPolicyProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeType; } /// Creates an new instance. public RoleManagementPolicyProperties() @@ -136,6 +157,9 @@ public partial interface IRoleManagementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy description.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -144,6 +168,9 @@ public partial interface IRoleManagementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy display name.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -152,14 +179,20 @@ public partial interface IRoleManagementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The readonly computed rule applied to the policy.", SerializedName = @"effectiveRules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] + System.Collections.Generic.List EffectiveRule { get; } /// The role management policy is default policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy is default policy.", SerializedName = @"isOrganizationDefault", PossibleTypes = new [] { typeof(bool) })] @@ -167,39 +200,54 @@ public partial interface IRoleManagementPolicyProperties : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -208,14 +256,20 @@ public partial interface IRoleManagementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The rule applied to the policy.", SerializedName = @"rules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] + System.Collections.Generic.List Rule { get; set; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -223,27 +277,36 @@ public partial interface IRoleManagementPolicyProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } } /// Role management policy properties with scope. @@ -255,11 +318,11 @@ internal partial interface IRoleManagementPolicyPropertiesInternal /// The role management policy display name. string DisplayName { get; set; } /// The readonly computed rule applied to the policy. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get; set; } + System.Collections.Generic.List EffectiveRule { get; set; } /// The role management policy is default policy. bool? IsOrganizationDefault { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get; set; } /// The name of the principal made changes string LastModifiedByDisplayName { get; set; } /// Email of principal @@ -271,11 +334,11 @@ internal partial interface IRoleManagementPolicyPropertiesInternal /// The last modified date time. global::System.DateTime? LastModifiedDateTime { get; set; } /// Additional properties of scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties PolicyProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties PolicyProperty { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope PolicyPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope PolicyPropertyScope { get; set; } /// The rule applied to the policy. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get; set; } + System.Collections.Generic.List Rule { get; set; } /// The role management policy scope. string Scope { get; set; } /// Display name of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.json.cs similarity index 86% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.json.cs index 3c938cd20575..8625b630e774 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyProperties(json) : null; } @@ -77,15 +77,15 @@ internal RoleManagementPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal.FromJson(__jsonLastModifiedBy) : LastModifiedBy;} - {_policyProperty = If( json?.PropertyT("policyProperties"), out var __jsonPolicyProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyProperties.FromJson(__jsonPolicyProperties) : PolicyProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_isOrganizationDefault = If( json?.PropertyT("isOrganizationDefault"), out var __jsonIsOrganizationDefault) ? (bool?)__jsonIsOrganizationDefault : IsOrganizationDefault;} - {_lastModifiedDateTime = If( json?.PropertyT("lastModifiedDateTime"), out var __jsonLastModifiedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedDateTimeValue) ? __jsonLastModifiedDateTimeValue : LastModifiedDateTime : LastModifiedDateTime;} - {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule.FromJson(__u) )) ))() : null : Rule;} - {_effectiveRule = If( json?.PropertyT("effectiveRules"), out var __jsonEffectiveRules) ? If( __jsonEffectiveRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule.FromJson(__p) )) ))() : null : EffectiveRule;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal.FromJson(__jsonLastModifiedBy) : _lastModifiedBy;} + {_policyProperty = If( json?.PropertyT("policyProperties"), out var __jsonPolicyProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyProperties.FromJson(__jsonPolicyProperties) : _policyProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_isOrganizationDefault = If( json?.PropertyT("isOrganizationDefault"), out var __jsonIsOrganizationDefault) ? (bool?)__jsonIsOrganizationDefault : _isOrganizationDefault;} + {_lastModifiedDateTime = If( json?.PropertyT("lastModifiedDateTime"), out var __jsonLastModifiedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedDateTimeValue) ? __jsonLastModifiedDateTimeValue : _lastModifiedDateTime : _lastModifiedDateTime;} + {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule.FromJson(__u) )) ))() : null : _rule;} + {_effectiveRule = If( json?.PropertyT("effectiveRules"), out var __jsonEffectiveRules) ? If( __jsonEffectiveRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule.FromJson(__p) )) ))() : null : _effectiveRule;} AfterFromJson(json); } @@ -108,22 +108,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastModifiedBy ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._lastModifiedBy.ToJson(null,serializationMode) : null, "lastModifiedBy" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._policyProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._policyProperty.ToJson(null,serializationMode) : null, "policyProperties" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); } AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); AddIf( null != this._isOrganizationDefault ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonBoolean((bool)this._isOrganizationDefault) : null, "isOrganizationDefault" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastModifiedDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._lastModifiedDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedDateTime" ,container.Add ); } @@ -136,7 +136,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J } container.Add("rules",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { if (null != this._effectiveRule) { diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.PowerShell.cs similarity index 53% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.PowerShell.cs index 20cb327f4e8f..43997db4aa79 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyRule partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyRule(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyRule(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,45 +113,45 @@ internal RoleManagementPolicyRule(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -158,39 +166,39 @@ internal RoleManagementPolicyRule(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -199,6 +207,18 @@ internal RoleManagementPolicyRule(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyRuleTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.TypeConverter.cs index 6fd7f0950b17..efd58d0ad6ff 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.cs similarity index 60% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.cs index 93601467ae24..d9b0b32bcdfe 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// Backing field for property. @@ -21,45 +21,45 @@ public partial class RoleManagementPolicyRule : public string Id { get => this._id; set => this._id = value; } /// Internal Acessors for Target - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal.Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget()); set { {_target = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget()); set { {_target = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType _ruleType; + private string _ruleType; /// The type of rule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => this._ruleType; set => this._ruleType = value; } + public string RuleType { get => this._ruleType; set => this._ruleType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget _target; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget _target; /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget()); set => this._target = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget()); set => this._target = value; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Caller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Caller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Caller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Caller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).EnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).EnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).EnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).EnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).InheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).InheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).InheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).InheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Level; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Level = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Level; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Level = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Operation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Operation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyRule() @@ -75,6 +75,9 @@ public partial interface IRoleManagementPolicyRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of the rule.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -83,14 +86,21 @@ public partial interface IRoleManagementPolicyRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of rule", SerializedName = @"ruleType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("RoleManagementPolicyApprovalRule", "RoleManagementPolicyAuthenticationContextRule", "RoleManagementPolicyEnablementRule", "RoleManagementPolicyExpirationRule", "RoleManagementPolicyNotificationRule")] + string RuleType { get; set; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The caller of the setting.", SerializedName = @"caller", PossibleTypes = new [] { typeof(string) })] @@ -99,22 +109,31 @@ public partial interface IRoleManagementPolicyRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of enforced settings.", SerializedName = @"enforcedSettings", PossibleTypes = new [] { typeof(string) })] - string[] TargetEnforcedSetting { get; set; } + System.Collections.Generic.List TargetEnforcedSetting { get; set; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of inheritable settings.", SerializedName = @"inheritableSettings", PossibleTypes = new [] { typeof(string) })] - string[] TargetInheritableSetting { get; set; } + System.Collections.Generic.List TargetInheritableSetting { get; set; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The assignment level to which it is applied.", SerializedName = @"level", PossibleTypes = new [] { typeof(string) })] @@ -123,18 +142,24 @@ public partial interface IRoleManagementPolicyRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of target objects.", SerializedName = @"targetObjects", PossibleTypes = new [] { typeof(string) })] - string[] TargetObject { get; set; } + System.Collections.Generic.List TargetObject { get; set; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of operation.", SerializedName = @"operations", PossibleTypes = new [] { typeof(string) })] - string[] TargetOperation { get; set; } + System.Collections.Generic.List TargetOperation { get; set; } } /// The role management policy rule. @@ -144,21 +169,22 @@ internal partial interface IRoleManagementPolicyRuleInternal /// The id of the rule. string Id { get; set; } /// The type of rule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("RoleManagementPolicyApprovalRule", "RoleManagementPolicyAuthenticationContextRule", "RoleManagementPolicyEnablementRule", "RoleManagementPolicyExpirationRule", "RoleManagementPolicyNotificationRule")] + string RuleType { get; set; } /// The target of the current rule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get; set; } /// The caller of the setting. string TargetCaller { get; set; } /// The list of enforced settings. - string[] TargetEnforcedSetting { get; set; } + System.Collections.Generic.List TargetEnforcedSetting { get; set; } /// The list of inheritable settings. - string[] TargetInheritableSetting { get; set; } + System.Collections.Generic.List TargetInheritableSetting { get; set; } /// The assignment level to which it is applied. string TargetLevel { get; set; } /// The list of target objects. - string[] TargetObject { get; set; } + System.Collections.Generic.List TargetObject { get; set; } /// The type of operation. - string[] TargetOperation { get; set; } + System.Collections.Generic.List TargetOperation { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.json.cs index 66d578a72d5b..84aa481c02d5 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,16 +54,15 @@ public partial class RoleManagementPolicyRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule - /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the - /// payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json)) { @@ -109,9 +108,9 @@ internal RoleManagementPolicyRule(Microsoft.Azure.PowerShell.Cmdlets.Resources.A { return; } - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget.FromJson(__jsonTarget) : Target;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_ruleType = If( json?.PropertyT("ruleType"), out var __jsonRuleType) ? (string)__jsonRuleType : (string)RuleType;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget.FromJson(__jsonTarget) : _target;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_ruleType = If( json?.PropertyT("ruleType"), out var __jsonRuleType) ? (string)__jsonRuleType : (string)_ruleType;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.PowerShell.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.PowerShell.cs index 804abe7bf975..19eb10376d68 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyRuleTarget partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyRuleTarget(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyRuleTarget(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,33 +113,33 @@ internal RoleManagementPolicyRuleTarget(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("Caller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Caller = (string) content.GetValueForProperty("Caller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Caller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Caller = (string) content.GetValueForProperty("Caller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Caller, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Operation = (string[]) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Operation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Operation = (System.Collections.Generic.List) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Operation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Level")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Level, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Level, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("InheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting = (string[]) content.GetValueForProperty("InheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("InheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("EnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting = (string[]) content.GetValueForProperty("EnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("EnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -146,27 +154,27 @@ internal RoleManagementPolicyRuleTarget(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("Caller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Caller = (string) content.GetValueForProperty("Caller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Caller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Caller = (string) content.GetValueForProperty("Caller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Caller, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Operation = (string[]) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Operation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Operation = (System.Collections.Generic.List) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Operation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Level")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Level, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Level, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("InheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting = (string[]) content.GetValueForProperty("InheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("InheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("EnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting = (string[]) content.GetValueForProperty("EnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("EnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -175,6 +183,18 @@ internal RoleManagementPolicyRuleTarget(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule target. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyRuleTargetTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.TypeConverter.cs index 81aaa123a0f6..2f43805d6e86 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.cs index 1ad42ed398c0..ba9a068b437d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule target. public partial class RoleManagementPolicyRuleTarget : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal { /// Backing field for property. @@ -21,18 +21,18 @@ public partial class RoleManagementPolicyRuleTarget : public string Caller { get => this._caller; set => this._caller = value; } /// Backing field for property. - private string[] _enforcedSetting; + private System.Collections.Generic.List _enforcedSetting; /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] EnforcedSetting { get => this._enforcedSetting; set => this._enforcedSetting = value; } + public System.Collections.Generic.List EnforcedSetting { get => this._enforcedSetting; set => this._enforcedSetting = value; } /// Backing field for property. - private string[] _inheritableSetting; + private System.Collections.Generic.List _inheritableSetting; /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] InheritableSetting { get => this._inheritableSetting; set => this._inheritableSetting = value; } + public System.Collections.Generic.List InheritableSetting { get => this._inheritableSetting; set => this._inheritableSetting = value; } /// Backing field for property. private string _level; @@ -42,18 +42,18 @@ public partial class RoleManagementPolicyRuleTarget : public string Level { get => this._level; set => this._level = value; } /// Backing field for property. - private string[] _operation; + private System.Collections.Generic.List _operation; /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] Operation { get => this._operation; set => this._operation = value; } + public System.Collections.Generic.List Operation { get => this._operation; set => this._operation = value; } /// Backing field for property. - private string[] _targetObject; + private System.Collections.Generic.List _targetObject; /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] TargetObject { get => this._targetObject; set => this._targetObject = value; } + public System.Collections.Generic.List TargetObject { get => this._targetObject; set => this._targetObject = value; } /// Creates an new instance. public RoleManagementPolicyRuleTarget() @@ -69,6 +69,9 @@ public partial interface IRoleManagementPolicyRuleTarget : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The caller of the setting.", SerializedName = @"caller", PossibleTypes = new [] { typeof(string) })] @@ -77,22 +80,31 @@ public partial interface IRoleManagementPolicyRuleTarget : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of enforced settings.", SerializedName = @"enforcedSettings", PossibleTypes = new [] { typeof(string) })] - string[] EnforcedSetting { get; set; } + System.Collections.Generic.List EnforcedSetting { get; set; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of inheritable settings.", SerializedName = @"inheritableSettings", PossibleTypes = new [] { typeof(string) })] - string[] InheritableSetting { get; set; } + System.Collections.Generic.List InheritableSetting { get; set; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The assignment level to which it is applied.", SerializedName = @"level", PossibleTypes = new [] { typeof(string) })] @@ -101,18 +113,24 @@ public partial interface IRoleManagementPolicyRuleTarget : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of operation.", SerializedName = @"operations", PossibleTypes = new [] { typeof(string) })] - string[] Operation { get; set; } + System.Collections.Generic.List Operation { get; set; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of target objects.", SerializedName = @"targetObjects", PossibleTypes = new [] { typeof(string) })] - string[] TargetObject { get; set; } + System.Collections.Generic.List TargetObject { get; set; } } /// The role management policy rule target. @@ -122,15 +140,15 @@ internal partial interface IRoleManagementPolicyRuleTargetInternal /// The caller of the setting. string Caller { get; set; } /// The list of enforced settings. - string[] EnforcedSetting { get; set; } + System.Collections.Generic.List EnforcedSetting { get; set; } /// The list of inheritable settings. - string[] InheritableSetting { get; set; } + System.Collections.Generic.List InheritableSetting { get; set; } /// The assignment level to which it is applied. string Level { get; set; } /// The type of operation. - string[] Operation { get; set; } + System.Collections.Generic.List Operation { get; set; } /// The list of target objects. - string[] TargetObject { get; set; } + System.Collections.Generic.List TargetObject { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.json.cs similarity index 86% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.json.cs index 50efdd233ad4..c98828cffd2a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyRuleTarget partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyRuleTarget(json) : null; } @@ -77,12 +77,12 @@ internal RoleManagementPolicyRuleTarget(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_caller = If( json?.PropertyT("caller"), out var __jsonCaller) ? (string)__jsonCaller : (string)Caller;} - {_operation = If( json?.PropertyT("operations"), out var __jsonOperations) ? If( __jsonOperations as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Operation;} - {_level = If( json?.PropertyT("level"), out var __jsonLevel) ? (string)__jsonLevel : (string)Level;} - {_targetObject = If( json?.PropertyT("targetObjects"), out var __jsonTargetObjects) ? If( __jsonTargetObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : TargetObject;} - {_inheritableSetting = If( json?.PropertyT("inheritableSettings"), out var __jsonInheritableSettings) ? If( __jsonInheritableSettings as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : InheritableSetting;} - {_enforcedSetting = If( json?.PropertyT("enforcedSettings"), out var __jsonEnforcedSettings) ? If( __jsonEnforcedSettings as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : EnforcedSetting;} + {_caller = If( json?.PropertyT("caller"), out var __jsonCaller) ? (string)__jsonCaller : (string)_caller;} + {_operation = If( json?.PropertyT("operations"), out var __jsonOperations) ? If( __jsonOperations as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _operation;} + {_level = If( json?.PropertyT("level"), out var __jsonLevel) ? (string)__jsonLevel : (string)_level;} + {_targetObject = If( json?.PropertyT("targetObjects"), out var __jsonTargetObjects) ? If( __jsonTargetObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _targetObject;} + {_inheritableSetting = If( json?.PropertyT("inheritableSettings"), out var __jsonInheritableSettings) ? If( __jsonInheritableSettings as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _inheritableSetting;} + {_enforcedSetting = If( json?.PropertyT("enforcedSettings"), out var __jsonEnforcedSettings) ? If( __jsonEnforcedSettings as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __g) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _enforcedSetting;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.PowerShell.cs similarity index 68% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.PowerShell.cs index d33fbe813b1c..c62412cc0b0f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class UserSet partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserSet(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserSet(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,25 +128,25 @@ internal UserSet(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("UserType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).UserType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType?) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).UserType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).UserType = (string) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).UserType, global::System.Convert.ToString); } if (content.Contains("IsBackup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).IsBackup = (bool?) content.GetValueForProperty("IsBackup",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).IsBackup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).IsBackup = (bool?) content.GetValueForProperty("IsBackup",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).IsBackup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Description, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -143,19 +161,19 @@ internal UserSet(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("UserType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).UserType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType?) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).UserType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).UserType = (string) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).UserType, global::System.Convert.ToString); } if (content.Contains("IsBackup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).IsBackup = (bool?) content.GetValueForProperty("IsBackup",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).IsBackup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).IsBackup = (bool?) content.GetValueForProperty("IsBackup",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).IsBackup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.TypeConverter.cs index 48bf009b6354..111ad4105eee 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.cs similarity index 84% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.cs index f1e2e64366ad..cd390ea20200 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The detail of a user. public partial class UserSet : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal { /// Backing field for property. @@ -35,11 +35,11 @@ public partial class UserSet : public bool? IsBackup { get => this._isBackup; set => this._isBackup = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType? _userType; + private string _userType; /// The type of user. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType? UserType { get => this._userType; set => this._userType = value; } + public string UserType { get => this._userType; set => this._userType = value; } /// Creates an new instance. public UserSet() @@ -55,6 +55,9 @@ public partial interface IUserSet : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the user.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IUserSet : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The object id of the user.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IUserSet : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value indicating whether the user is a backup fallback approver", SerializedName = @"isBackup", PossibleTypes = new [] { typeof(bool) })] @@ -79,10 +88,14 @@ public partial interface IUserSet : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of user.", SerializedName = @"userType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType? UserType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group")] + string UserType { get; set; } } /// The detail of a user. @@ -96,7 +109,8 @@ internal partial interface IUserSetInternal /// The value indicating whether the user is a backup fallback approver bool? IsBackup { get; set; } /// The type of user. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType? UserType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group")] + string UserType { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.json.cs similarity index 95% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.json.cs index e4c82f4af948..258b8fa611ce 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class UserSet partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new UserSet(json) : null; } @@ -104,10 +104,10 @@ internal UserSet(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runt { return; } - {_userType = If( json?.PropertyT("userType"), out var __jsonUserType) ? (string)__jsonUserType : (string)UserType;} - {_isBackup = If( json?.PropertyT("isBackup"), out var __jsonIsBackup) ? (bool?)__jsonIsBackup : IsBackup;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_userType = If( json?.PropertyT("userType"), out var __jsonUserType) ? (string)__jsonUserType : (string)_userType;} + {_isBackup = If( json?.PropertyT("isBackup"), out var __jsonIsBackup) ? (bool?)__jsonIsBackup : _isBackup;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.Completer.cs deleted file mode 100644 index 6d41dd0165e0..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of rule - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalModeTypeConverter))] - public partial struct ApprovalMode : - 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) || "SingleStage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SingleStage'", "SingleStage", global::System.Management.Automation.CompletionResultType.ParameterValue, "SingleStage"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Serial".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Serial'", "Serial", global::System.Management.Automation.CompletionResultType.ParameterValue, "Serial"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Parallel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Parallel'", "Parallel", global::System.Management.Automation.CompletionResultType.ParameterValue, "Parallel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NoApproval".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NoApproval'", "NoApproval", global::System.Management.Automation.CompletionResultType.ParameterValue, "NoApproval"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.TypeConverter.cs deleted file mode 100644 index 28e93ae76e6f..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of rule - public partial class ApprovalModeTypeConverter : - 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) => ApprovalMode.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/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.cs deleted file mode 100644 index 859f3024d5da..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of rule - public partial struct ApprovalMode : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode NoApproval = @"NoApproval"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode Parallel = @"Parallel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode Serial = @"Serial"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode SingleStage = @"SingleStage"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ApprovalMode(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ApprovalMode - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ApprovalMode(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ApprovalMode - /// 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.Resources.Authorization.Support.ApprovalMode e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ApprovalMode (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 ApprovalMode && Equals((ApprovalMode)obj); - } - - /// Returns hashCode for enum ApprovalMode - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ApprovalMode - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ApprovalMode - /// the value to convert to an instance of . - - public static implicit operator ApprovalMode(string value) - { - return new ApprovalMode(value); - } - - /// Implicit operator to convert ApprovalMode to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode e) - { - return e._value; - } - - /// Overriding != operator for enum ApprovalMode - /// 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.Resources.Authorization.Support.ApprovalMode e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ApprovalMode - /// 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.Resources.Authorization.Support.ApprovalMode e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.Completer.cs deleted file mode 100644 index f98767fd3c20..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// Assignment type of the role assignment schedule - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentTypeTypeConverter))] - public partial struct AssignmentType : - 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) || "Activated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Activated'", "Activated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Activated"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Assigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Assigned'", "Assigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Assigned"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.TypeConverter.cs deleted file mode 100644 index 0f6474ea1226..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// Assignment type of the role assignment schedule - public partial class AssignmentTypeTypeConverter : - 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) => AssignmentType.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/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.cs deleted file mode 100644 index 0b265e86f4ad..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// Assignment type of the role assignment schedule - public partial struct AssignmentType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType Activated = @"Activated"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType Assigned = @"Assigned"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AssignmentType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AssignmentType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AssignmentType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AssignmentType - /// 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.Resources.Authorization.Support.AssignmentType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AssignmentType (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 AssignmentType && Equals((AssignmentType)obj); - } - - /// Returns hashCode for enum AssignmentType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AssignmentType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AssignmentType - /// the value to convert to an instance of . - - public static implicit operator AssignmentType(string value) - { - return new AssignmentType(value); - } - - /// Implicit operator to convert AssignmentType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType e) - { - return e._value; - } - - /// Overriding != operator for enum AssignmentType - /// 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.Resources.Authorization.Support.AssignmentType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AssignmentType - /// 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.Resources.Authorization.Support.AssignmentType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.Completer.cs deleted file mode 100644 index 52c6fff8aea1..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of enable rules - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRulesTypeConverter))] - public partial struct EnablementRules : - 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) || "MultiFactorAuthentication".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MultiFactorAuthentication'", "MultiFactorAuthentication", global::System.Management.Automation.CompletionResultType.ParameterValue, "MultiFactorAuthentication"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Justification".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Justification'", "Justification", global::System.Management.Automation.CompletionResultType.ParameterValue, "Justification"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Ticketing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Ticketing'", "Ticketing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Ticketing"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.TypeConverter.cs deleted file mode 100644 index e5dc627a41cd..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of enable rules - public partial class EnablementRulesTypeConverter : - 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) => EnablementRules.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/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.cs deleted file mode 100644 index 5a8fcead0c27..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of enable rules - public partial struct EnablementRules : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules Justification = @"Justification"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules MultiFactorAuthentication = @"MultiFactorAuthentication"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules Ticketing = @"Ticketing"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to EnablementRules - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new EnablementRules(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private EnablementRules(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type EnablementRules - /// 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.Resources.Authorization.Support.EnablementRules e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type EnablementRules (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 EnablementRules && Equals((EnablementRules)obj); - } - - /// Returns hashCode for enum EnablementRules - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for EnablementRules - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to EnablementRules - /// the value to convert to an instance of . - - public static implicit operator EnablementRules(string value) - { - return new EnablementRules(value); - } - - /// Implicit operator to convert EnablementRules to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules e) - { - return e._value; - } - - /// Overriding != operator for enum EnablementRules - /// 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.Resources.Authorization.Support.EnablementRules e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum EnablementRules - /// 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.Resources.Authorization.Support.EnablementRules e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.Completer.cs deleted file mode 100644 index ab01fe121926..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// Membership type of the role assignment schedule - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberTypeTypeConverter))] - public partial struct MemberType : - 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) || "Inherited".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Inherited'", "Inherited", global::System.Management.Automation.CompletionResultType.ParameterValue, "Inherited"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Direct".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Direct'", "Direct", global::System.Management.Automation.CompletionResultType.ParameterValue, "Direct"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Group".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Group'", "Group", global::System.Management.Automation.CompletionResultType.ParameterValue, "Group"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.TypeConverter.cs deleted file mode 100644 index e4f4a4d719a7..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// Membership type of the role assignment schedule - public partial class MemberTypeTypeConverter : - 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) => MemberType.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/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.cs deleted file mode 100644 index b6a8364f7293..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// Membership type of the role assignment schedule - public partial struct MemberType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType Direct = @"Direct"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType Group = @"Group"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType Inherited = @"Inherited"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to MemberType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MemberType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MemberType - /// 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.Resources.Authorization.Support.MemberType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type MemberType (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 MemberType && Equals((MemberType)obj); - } - - /// Returns hashCode for enum MemberType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private MemberType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MemberType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MemberType - /// the value to convert to an instance of . - - public static implicit operator MemberType(string value) - { - return new MemberType(value); - } - - /// Implicit operator to convert MemberType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType e) - { - return e._value; - } - - /// Overriding != operator for enum MemberType - /// 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.Resources.Authorization.Support.MemberType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MemberType - /// 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.Resources.Authorization.Support.MemberType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.Completer.cs deleted file mode 100644 index a0673560fb1a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.Completer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of notification. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanismTypeConverter))] - public partial struct NotificationDeliveryMechanism : - 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) || "Email".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Email'", "Email", global::System.Management.Automation.CompletionResultType.ParameterValue, "Email"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.TypeConverter.cs deleted file mode 100644 index fd41b8a926cd..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of notification. - public partial class NotificationDeliveryMechanismTypeConverter : - 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) => NotificationDeliveryMechanism.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/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.cs deleted file mode 100644 index 9ee533a3139d..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of notification. - public partial struct NotificationDeliveryMechanism : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism Email = @"Email"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to NotificationDeliveryMechanism - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new NotificationDeliveryMechanism(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type NotificationDeliveryMechanism - /// 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.Resources.Authorization.Support.NotificationDeliveryMechanism e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type NotificationDeliveryMechanism (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 NotificationDeliveryMechanism && Equals((NotificationDeliveryMechanism)obj); - } - - /// Returns hashCode for enum NotificationDeliveryMechanism - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private NotificationDeliveryMechanism(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for NotificationDeliveryMechanism - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to NotificationDeliveryMechanism - /// the value to convert to an instance of . - - public static implicit operator NotificationDeliveryMechanism(string value) - { - return new NotificationDeliveryMechanism(value); - } - - /// Implicit operator to convert NotificationDeliveryMechanism to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism e) - { - return e._value; - } - - /// Overriding != operator for enum NotificationDeliveryMechanism - /// 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.Resources.Authorization.Support.NotificationDeliveryMechanism e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum NotificationDeliveryMechanism - /// 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.Resources.Authorization.Support.NotificationDeliveryMechanism e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.Completer.cs deleted file mode 100644 index 30d13a8b4134..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The notification level. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevelTypeConverter))] - public partial struct NotificationLevel : - 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) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Critical".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Critical'", "Critical", global::System.Management.Automation.CompletionResultType.ParameterValue, "Critical"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "All".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'All'", "All", global::System.Management.Automation.CompletionResultType.ParameterValue, "All"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.TypeConverter.cs deleted file mode 100644 index 3d43978ca4a2..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The notification level. - public partial class NotificationLevelTypeConverter : - 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) => NotificationLevel.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/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.cs deleted file mode 100644 index f36e415e51a0..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The notification level. - public partial struct NotificationLevel : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel All = @"All"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel Critical = @"Critical"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel None = @"None"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to NotificationLevel - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new NotificationLevel(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type NotificationLevel - /// 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.Resources.Authorization.Support.NotificationLevel e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type NotificationLevel (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 NotificationLevel && Equals((NotificationLevel)obj); - } - - /// Returns hashCode for enum NotificationLevel - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private NotificationLevel(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for NotificationLevel - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to NotificationLevel - /// the value to convert to an instance of . - - public static implicit operator NotificationLevel(string value) - { - return new NotificationLevel(value); - } - - /// Implicit operator to convert NotificationLevel to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel e) - { - return e._value; - } - - /// Overriding != operator for enum NotificationLevel - /// 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.Resources.Authorization.Support.NotificationLevel e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum NotificationLevel - /// 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.Resources.Authorization.Support.NotificationLevel e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.Completer.cs deleted file mode 100644 index a7e8633c5407..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.Completer.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The principal type of the assigned principal ID. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalTypeTypeConverter))] - public partial struct PrincipalType : - 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) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Group".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Group'", "Group", global::System.Management.Automation.CompletionResultType.ParameterValue, "Group"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ServicePrincipal".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ServicePrincipal'", "ServicePrincipal", global::System.Management.Automation.CompletionResultType.ParameterValue, "ServicePrincipal"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DirectoryRoleTemplate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DirectoryRoleTemplate'", "DirectoryRoleTemplate", global::System.Management.Automation.CompletionResultType.ParameterValue, "DirectoryRoleTemplate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ForeignGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ForeignGroup'", "ForeignGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ForeignGroup"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MSI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MSI'", "MSI", global::System.Management.Automation.CompletionResultType.ParameterValue, "MSI"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DirectoryObjectOrGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DirectoryObjectOrGroup'", "DirectoryObjectOrGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "DirectoryObjectOrGroup"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Everyone".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Everyone'", "Everyone", global::System.Management.Automation.CompletionResultType.ParameterValue, "Everyone"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Device".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Device'", "Device", global::System.Management.Automation.CompletionResultType.ParameterValue, "Device"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.TypeConverter.cs deleted file mode 100644 index d5e9b748c3f2..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The principal type of the assigned principal ID. - public partial class PrincipalTypeTypeConverter : - 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) => PrincipalType.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/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.cs deleted file mode 100644 index 94fe7601f15d..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The principal type of the assigned principal ID. - public partial struct PrincipalType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Device = @"Device"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType DirectoryObjectOrGroup = @"DirectoryObjectOrGroup"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType DirectoryRoleTemplate = @"DirectoryRoleTemplate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Everyone = @"Everyone"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType ForeignGroup = @"ForeignGroup"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Group = @"Group"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Msi = @"MSI"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType ServicePrincipal = @"ServicePrincipal"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Unknown = @"Unknown"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PrincipalType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PrincipalType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PrincipalType - /// 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.Resources.Authorization.Support.PrincipalType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PrincipalType (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 PrincipalType && Equals((PrincipalType)obj); - } - - /// Returns hashCode for enum PrincipalType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private PrincipalType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PrincipalType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PrincipalType - /// the value to convert to an instance of . - - public static implicit operator PrincipalType(string value) - { - return new PrincipalType(value); - } - - /// Implicit operator to convert PrincipalType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType e) - { - return e._value; - } - - /// Overriding != operator for enum PrincipalType - /// 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.Resources.Authorization.Support.PrincipalType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PrincipalType - /// 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.Resources.Authorization.Support.PrincipalType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.Completer.cs deleted file mode 100644 index c3dbd517ed68..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The recipient type. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientTypeTypeConverter))] - public partial struct RecipientType : - 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) || "Requestor".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Requestor'", "Requestor", global::System.Management.Automation.CompletionResultType.ParameterValue, "Requestor"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Approver".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Approver'", "Approver", global::System.Management.Automation.CompletionResultType.ParameterValue, "Approver"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Admin".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Admin'", "Admin", global::System.Management.Automation.CompletionResultType.ParameterValue, "Admin"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.TypeConverter.cs deleted file mode 100644 index 6aae6361864a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The recipient type. - public partial class RecipientTypeTypeConverter : - 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) => RecipientType.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/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.cs deleted file mode 100644 index 30e6cfd27c15..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The recipient type. - public partial struct RecipientType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType Admin = @"Admin"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType Approver = @"Approver"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType Requestor = @"Requestor"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RecipientType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RecipientType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RecipientType - /// 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.Resources.Authorization.Support.RecipientType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RecipientType (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 RecipientType && Equals((RecipientType)obj); - } - - /// Returns hashCode for enum RecipientType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private RecipientType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RecipientType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RecipientType - /// the value to convert to an instance of . - - public static implicit operator RecipientType(string value) - { - return new RecipientType(value); - } - - /// Implicit operator to convert RecipientType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType e) - { - return e._value; - } - - /// Overriding != operator for enum RecipientType - /// 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.Resources.Authorization.Support.RecipientType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RecipientType - /// 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.Resources.Authorization.Support.RecipientType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.Completer.cs deleted file mode 100644 index 7fb03413e2b7..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.Completer.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// - /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestTypeTypeConverter))] - public partial struct RequestType : - 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) || "AdminAssign".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminAssign'", "AdminAssign", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminAssign"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminRemove".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminRemove'", "AdminRemove", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminRemove"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminUpdate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminUpdate'", "AdminUpdate", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminUpdate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminExtend".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminExtend'", "AdminExtend", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminExtend"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminRenew".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminRenew'", "AdminRenew", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminRenew"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfActivate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfActivate'", "SelfActivate", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfActivate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfDeactivate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfDeactivate'", "SelfDeactivate", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfDeactivate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfExtend".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfExtend'", "SelfExtend", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfExtend"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfRenew".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfRenew'", "SelfRenew", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfRenew"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.TypeConverter.cs deleted file mode 100644 index 711434d50fd9..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// - /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc - /// - public partial class RequestTypeTypeConverter : - 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) => RequestType.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/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.cs deleted file mode 100644 index f655be82926e..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// - /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc - /// - public partial struct RequestType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminAssign = @"AdminAssign"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminExtend = @"AdminExtend"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminRemove = @"AdminRemove"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminRenew = @"AdminRenew"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminUpdate = @"AdminUpdate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType SelfActivate = @"SelfActivate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType SelfDeactivate = @"SelfDeactivate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType SelfExtend = @"SelfExtend"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType SelfRenew = @"SelfRenew"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RequestType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RequestType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RequestType - /// 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.Resources.Authorization.Support.RequestType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RequestType (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 RequestType && Equals((RequestType)obj); - } - - /// Returns hashCode for enum RequestType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private RequestType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RequestType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RequestType - /// the value to convert to an instance of . - - public static implicit operator RequestType(string value) - { - return new RequestType(value); - } - - /// Implicit operator to convert RequestType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType e) - { - return e._value; - } - - /// Overriding != operator for enum RequestType - /// 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.Resources.Authorization.Support.RequestType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RequestType - /// 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.Resources.Authorization.Support.RequestType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.Completer.cs deleted file mode 100644 index 339291a8ac66..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.Completer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of rule - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleTypeTypeConverter))] - public partial struct RoleManagementPolicyRuleType : - 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) || "RoleManagementPolicyApprovalRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyApprovalRule'", "RoleManagementPolicyApprovalRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyApprovalRule"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RoleManagementPolicyAuthenticationContextRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyAuthenticationContextRule'", "RoleManagementPolicyAuthenticationContextRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyAuthenticationContextRule"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RoleManagementPolicyEnablementRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyEnablementRule'", "RoleManagementPolicyEnablementRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyEnablementRule"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RoleManagementPolicyExpirationRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyExpirationRule'", "RoleManagementPolicyExpirationRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyExpirationRule"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RoleManagementPolicyNotificationRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyNotificationRule'", "RoleManagementPolicyNotificationRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyNotificationRule"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.TypeConverter.cs deleted file mode 100644 index 2f3b12c9b716..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of rule - public partial class RoleManagementPolicyRuleTypeTypeConverter : - 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) => RoleManagementPolicyRuleType.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/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.cs deleted file mode 100644 index a662c163885c..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of rule - public partial struct RoleManagementPolicyRuleType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyApprovalRule = @"RoleManagementPolicyApprovalRule"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyAuthenticationContextRule = @"RoleManagementPolicyAuthenticationContextRule"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyEnablementRule = @"RoleManagementPolicyEnablementRule"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyExpirationRule = @"RoleManagementPolicyExpirationRule"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyNotificationRule = @"RoleManagementPolicyNotificationRule"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to RoleManagementPolicyRuleType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RoleManagementPolicyRuleType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RoleManagementPolicyRuleType - /// 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.Resources.Authorization.Support.RoleManagementPolicyRuleType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RoleManagementPolicyRuleType (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 RoleManagementPolicyRuleType && Equals((RoleManagementPolicyRuleType)obj); - } - - /// Returns hashCode for enum RoleManagementPolicyRuleType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private RoleManagementPolicyRuleType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RoleManagementPolicyRuleType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RoleManagementPolicyRuleType - /// the value to convert to an instance of . - - public static implicit operator RoleManagementPolicyRuleType(string value) - { - return new RoleManagementPolicyRuleType(value); - } - - /// Implicit operator to convert RoleManagementPolicyRuleType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType e) - { - return e._value; - } - - /// Overriding != operator for enum RoleManagementPolicyRuleType - /// 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.Resources.Authorization.Support.RoleManagementPolicyRuleType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RoleManagementPolicyRuleType - /// 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.Resources.Authorization.Support.RoleManagementPolicyRuleType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Status.Completer.cs deleted file mode 100644 index 1c4b6595c1a5..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.Completer.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The status of the role assignment schedule. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.StatusTypeConverter))] - public partial struct Status : - 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) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingEvaluation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingEvaluation'", "PendingEvaluation", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingEvaluation"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Granted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Granted'", "Granted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Granted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Denied".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Denied'", "Denied", global::System.Management.Automation.CompletionResultType.ParameterValue, "Denied"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingProvisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingProvisioning'", "PendingProvisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingProvisioning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioned'", "Provisioned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingRevocation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingRevocation'", "PendingRevocation", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingRevocation"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Revoked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Revoked'", "Revoked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Revoked"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingApprovalProvisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingApprovalProvisioning'", "PendingApprovalProvisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingApprovalProvisioning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingApproval".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingApproval'", "PendingApproval", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingApproval"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FailedAsResourceIsLocked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FailedAsResourceIsLocked'", "FailedAsResourceIsLocked", global::System.Management.Automation.CompletionResultType.ParameterValue, "FailedAsResourceIsLocked"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingAdminDecision".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingAdminDecision'", "PendingAdminDecision", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingAdminDecision"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminApproved".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminApproved'", "AdminApproved", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminApproved"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminDenied".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminDenied'", "AdminDenied", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminDenied"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TimedOut".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TimedOut'", "TimedOut", global::System.Management.Automation.CompletionResultType.ParameterValue, "TimedOut"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ProvisioningStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ProvisioningStarted'", "ProvisioningStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "ProvisioningStarted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingScheduleCreation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingScheduleCreation'", "PendingScheduleCreation", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingScheduleCreation"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ScheduleCreated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ScheduleCreated'", "ScheduleCreated", global::System.Management.Automation.CompletionResultType.ParameterValue, "ScheduleCreated"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingExternalProvisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingExternalProvisioning'", "PendingExternalProvisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingExternalProvisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Status.TypeConverter.cs deleted file mode 100644 index c4dafa33eeb1..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The status of the role assignment schedule. - public partial class StatusTypeConverter : - 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) => Status.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/generated/Resources/Authorization.Autorest/generated/api/Support/Status.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Status.cs deleted file mode 100644 index b276b054ab63..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The status of the role assignment schedule. - public partial struct Status : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status AdminApproved = @"AdminApproved"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status AdminDenied = @"AdminDenied"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Denied = @"Denied"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status FailedAsResourceIsLocked = @"FailedAsResourceIsLocked"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Granted = @"Granted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Invalid = @"Invalid"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingAdminDecision = @"PendingAdminDecision"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingApproval = @"PendingApproval"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingApprovalProvisioning = @"PendingApprovalProvisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingEvaluation = @"PendingEvaluation"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingExternalProvisioning = @"PendingExternalProvisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingProvisioning = @"PendingProvisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingRevocation = @"PendingRevocation"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingScheduleCreation = @"PendingScheduleCreation"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Provisioned = @"Provisioned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status ProvisioningStarted = @"ProvisioningStarted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Revoked = @"Revoked"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status ScheduleCreated = @"ScheduleCreated"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status TimedOut = @"TimedOut"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Status - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Status(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Status - /// 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.Resources.Authorization.Support.Status e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Status (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 Status && Equals((Status)obj); - } - - /// Returns hashCode for enum Status - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private Status(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Status - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Status - /// the value to convert to an instance of . - - public static implicit operator Status(string value) - { - return new Status(value); - } - - /// Implicit operator to convert Status to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status e) - { - return e._value; - } - - /// Overriding != operator for enum Status - /// 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.Resources.Authorization.Support.Status e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Status - /// 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.Resources.Authorization.Support.Status e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Type.Completer.cs deleted file mode 100644 index eb42bed154f0..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// Type of the role assignment schedule expiration - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.TypeTypeConverter))] - public partial struct Type : - 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) || "AfterDuration".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AfterDuration'", "AfterDuration", global::System.Management.Automation.CompletionResultType.ParameterValue, "AfterDuration"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AfterDateTime".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AfterDateTime'", "AfterDateTime", global::System.Management.Automation.CompletionResultType.ParameterValue, "AfterDateTime"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NoExpiration".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NoExpiration'", "NoExpiration", global::System.Management.Automation.CompletionResultType.ParameterValue, "NoExpiration"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Type.TypeConverter.cs deleted file mode 100644 index 910feefa97ee..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// Type of the role assignment schedule expiration - public partial class TypeTypeConverter : - 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) => Type.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/generated/Resources/Authorization.Autorest/generated/api/Support/Type.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Type.cs deleted file mode 100644 index bfb2806a4b1a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// Type of the role assignment schedule expiration - public partial struct Type : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type AfterDateTime = @"AfterDateTime"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type AfterDuration = @"AfterDuration"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type NoExpiration = @"NoExpiration"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Type - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Type(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Type - /// 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.Resources.Authorization.Support.Type e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Type (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 Type && Equals((Type)obj); - } - - /// Returns hashCode for enum Type - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for Type - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private Type(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to Type - /// the value to convert to an instance of . - - public static implicit operator Type(string value) - { - return new Type(value); - } - - /// Implicit operator to convert Type to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type e) - { - return e._value; - } - - /// Overriding != operator for enum Type - /// 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.Resources.Authorization.Support.Type e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Type - /// 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.Resources.Authorization.Support.Type e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.Completer.cs deleted file mode 100644 index a3be735cd716..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of user. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserTypeTypeConverter))] - public partial struct UserType : - 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) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Group".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Group'", "Group", global::System.Management.Automation.CompletionResultType.ParameterValue, "Group"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.TypeConverter.cs deleted file mode 100644 index 163527978c83..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of user. - public partial class UserTypeTypeConverter : - 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) => UserType.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/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.cs deleted file mode 100644 index 729249742513..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support -{ - - /// The type of user. - public partial struct UserType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType Group = @"Group"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to UserType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new UserType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type UserType - /// 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.Resources.Authorization.Support.UserType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type UserType (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 UserType && Equals((UserType)obj); - } - - /// Returns hashCode for enum UserType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for UserType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private UserType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to UserType - /// the value to convert to an instance of . - - public static implicit operator UserType(string value) - { - return new UserType(value); - } - - /// Implicit operator to convert UserType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType e) - { - return e._value; - } - - /// Overriding != operator for enum UserType - /// 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.Resources.Authorization.Support.UserType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum UserType - /// 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.Resources.Authorization.Support.UserType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs index 429f6f0803df..be4721639240 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets the specified role assignment schedule instance. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleInstance_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role assignment schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -130,24 +151,24 @@ public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance /// 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); + 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) @@ -170,6 +191,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleInstance_Get() { @@ -242,8 +268,33 @@ public GetAzRoleAssignmentScheduleInstance_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -352,12 +403,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,15 +425,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -392,12 +443,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs index 57923bee8811..71fb09270558 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets the specified role assignment schedule instance. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleInstance_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role assignment schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -86,7 +107,7 @@ public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -109,24 +130,24 @@ public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance /// 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); + 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) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleInstance_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleAssignmentScheduleInstance_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -347,12 +398,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -369,7 +420,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs index 7ac7823d83f2..3c14880e2d54 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role assignment schedule instances of a role assignment schedule. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleInstance_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role assignment schedule instances of a role assignment schedule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -103,7 +124,7 @@ public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -140,24 +161,24 @@ public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult /// 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); + 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) @@ -180,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleInstance_List() { @@ -252,8 +278,33 @@ public GetAzRoleAssignmentScheduleInstance_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +413,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -384,15 +435,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -402,12 +453,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -419,15 +470,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs index 17c7d54d1665..f0e686e9e24e 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role assignment schedule request. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleRequest_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -130,24 +151,24 @@ public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// 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); + 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) @@ -170,6 +191,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleRequest_Get() { @@ -242,8 +268,33 @@ public GetAzRoleAssignmentScheduleRequest_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -352,12 +403,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,15 +425,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -392,12 +443,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs index 1acd1dec2eab..558de3c48a7d 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role assignment schedule request. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleRequest_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -86,7 +107,7 @@ public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -109,24 +130,24 @@ public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// 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); + 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) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleRequest_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleAssignmentScheduleRequest_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -347,12 +398,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -369,7 +420,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs index abce2dee5433..37322b60fccb 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role assignment schedule requests for a scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleRequest_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role assignment schedule requests for a scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -104,7 +125,7 @@ public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -141,24 +162,24 @@ public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult /// 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); + 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) @@ -181,6 +202,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -202,7 +228,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleRequest_List() { @@ -253,8 +279,33 @@ public GetAzRoleAssignmentScheduleRequest_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -307,7 +358,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -325,7 +376,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -363,12 +414,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -385,15 +436,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -403,12 +454,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -420,15 +471,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs index aaa59ec8222e..ee582fc47e1a 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role assignment schedule for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentSchedule_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -130,24 +151,24 @@ public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule /// 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); + 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) @@ -170,6 +191,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentSchedule_Get() { @@ -242,8 +268,33 @@ public GetAzRoleAssignmentSchedule_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -352,12 +403,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,15 +425,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -392,12 +443,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs index 81057ce041c7..4595b3d5d58e 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role assignment schedule for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentSchedule_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -86,7 +107,7 @@ public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -109,24 +130,24 @@ public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule /// 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); + 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) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentSchedule_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleAssignmentSchedule_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -347,12 +398,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -369,7 +420,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs index 705963db42c6..f404f1748171 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role assignment schedules for a resource scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentSchedule_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role assignment schedules for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentSchedule_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleAssignmentSchedule_List : global::System.Managemen /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleAssignmentSchedule_List : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -103,7 +124,7 @@ public partial class GetAzRoleAssignmentSchedule_List : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -140,24 +161,24 @@ public partial class GetAzRoleAssignmentSchedule_List : global::System.Managemen /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult /// 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); + 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) @@ -180,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentSchedule_List() { @@ -252,8 +278,33 @@ public GetAzRoleAssignmentSchedule_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +413,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -384,15 +435,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -402,12 +453,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -419,15 +470,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs index 1493a9f81915..1d4a11a83149 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets the specified role eligibility schedule instance. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleInstance_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role eligibility schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -95,7 +116,7 @@ public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -132,24 +153,24 @@ public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance /// 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); + 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) @@ -172,6 +193,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -193,7 +219,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleInstance_Get() { @@ -244,8 +270,33 @@ public GetAzRoleEligibilityScheduleInstance_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -298,7 +349,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -316,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,12 +405,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -376,15 +427,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -394,12 +445,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -411,8 +462,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs index 3c1abf14ae47..43d009461fda 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets the specified role eligibility schedule instance. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleInstance_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role eligibility schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : globa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : globa [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -86,7 +107,7 @@ public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -109,24 +130,24 @@ public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : globa /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance /// 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); + 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) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleInstance_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleEligibilityScheduleInstance_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -347,12 +398,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -369,7 +420,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs index ff971b526b84..4395c59074be 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role eligibility schedule instances of a role eligibility schedule. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleInstance_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role eligibility schedule instances of a role eligibility schedule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleInstance_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleEligibilityScheduleInstance_List : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleEligibilityScheduleInstance_List : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -103,7 +124,7 @@ public partial class GetAzRoleEligibilityScheduleInstance_List : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -140,24 +161,24 @@ public partial class GetAzRoleEligibilityScheduleInstance_List : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult /// 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); + 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) @@ -180,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleInstance_List() { @@ -252,8 +278,33 @@ public GetAzRoleEligibilityScheduleInstance_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +413,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -384,15 +435,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -402,12 +453,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -419,15 +470,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs index 51cb36c485ae..8712dfd6adcf 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role eligibility schedule request. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleRequest_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -130,24 +151,24 @@ public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// 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); + 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) @@ -170,6 +191,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleRequest_Get() { @@ -242,8 +268,33 @@ public GetAzRoleEligibilityScheduleRequest_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -352,12 +403,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,15 +425,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -392,12 +443,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs index f4274c915a14..915e0a5d05c7 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role eligibility schedule request. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleRequest_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -86,7 +107,7 @@ public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -109,24 +130,24 @@ public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// 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); + 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) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleRequest_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleEligibilityScheduleRequest_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -347,12 +398,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -369,7 +420,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs index 804b2c7e6308..4b30d461c399 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role eligibility schedule requests for a scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleRequest_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role eligibility schedule requests for a scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -104,7 +125,7 @@ public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -141,24 +162,24 @@ public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult /// 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); + 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) @@ -181,6 +202,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -202,7 +228,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleRequest_List() { @@ -253,8 +279,33 @@ public GetAzRoleEligibilityScheduleRequest_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -307,7 +358,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -325,7 +376,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -363,12 +414,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -385,15 +436,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -403,12 +454,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -420,15 +471,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs index b4a3f0ebf257..610f440058f2 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role eligibility schedule for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilitySchedule_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilitySchedule_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilitySchedule_Get : global::System.Managemen /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilitySchedule_Get : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class GetAzRoleEligibilitySchedule_Get : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -130,24 +151,24 @@ public partial class GetAzRoleEligibilitySchedule_Get : global::System.Managemen /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule /// 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); + 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) @@ -170,6 +191,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilitySchedule_Get() { @@ -242,8 +268,33 @@ public GetAzRoleEligibilitySchedule_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -352,12 +403,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,15 +425,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -392,12 +443,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs index 701b708b9926..fc2a4eb88574 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role eligibility schedule for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilitySchedule_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::Syste /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -86,7 +107,7 @@ public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -109,24 +130,24 @@ public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::Syste /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule /// 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); + 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) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilitySchedule_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleEligibilitySchedule_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -347,12 +398,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -369,7 +420,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs index 8edba77dd31e..65865a9e6266 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role eligibility schedules for a resource scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilitySchedule_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role eligibility schedules for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilitySchedule_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleEligibilitySchedule_List : global::System.Manageme /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleEligibilitySchedule_List : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -103,7 +124,7 @@ public partial class GetAzRoleEligibilitySchedule_List : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -140,24 +161,24 @@ public partial class GetAzRoleEligibilitySchedule_List : global::System.Manageme /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult /// 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); + 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) @@ -180,6 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilitySchedule_List() { @@ -252,8 +278,33 @@ public GetAzRoleEligibilitySchedule_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +413,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -384,15 +435,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -402,12 +453,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -419,15 +470,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs index 297a2b811358..24e63d944f91 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the child resources of a resource on which user has eligible access @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/eligibleChildResources" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibleChildResource_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the child resources of a resource on which user has eligible access")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/eligibleChildResources", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibleChildResource_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleEligibleChildResource_Get : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleEligibleChildResource_Get : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -102,7 +123,7 @@ public partial class GetAzRoleEligibleChildResource_Get : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -139,24 +160,24 @@ public partial class GetAzRoleEligibleChildResource_Get : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult /// 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); + 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) @@ -179,6 +200,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -200,7 +226,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibleChildResource_Get() { @@ -251,8 +277,33 @@ public GetAzRoleEligibleChildResource_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -305,7 +356,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -361,12 +412,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -383,15 +434,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -401,12 +452,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -418,15 +469,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs index 44f9fca25201..6a517fcc9bcd 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role management policy assignment for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicyAssignment_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy assignment for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -130,24 +151,24 @@ public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// 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); + 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) @@ -170,6 +191,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicyAssignment_Get() { @@ -242,8 +268,33 @@ public GetAzRoleManagementPolicyAssignment_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -352,12 +403,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,15 +425,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -392,12 +443,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs index c16034f7ed22..083866b564b1 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role management policy assignment for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicyAssignment_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy assignment for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -86,7 +107,7 @@ public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -109,24 +130,24 @@ public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// 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); + 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) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicyAssignment_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleManagementPolicyAssignment_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -347,12 +398,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -369,7 +420,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs index 774ad527b8de..791262abd377 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role management assignment policies for a resource scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicyAssignment_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role management assignment policies for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicyAssignment_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleManagementPolicyAssignment_List : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleManagementPolicyAssignment_List : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -84,7 +105,7 @@ public partial class GetAzRoleManagementPolicyAssignment_List : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -121,24 +142,24 @@ public partial class GetAzRoleManagementPolicyAssignment_List : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult /// 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); + 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) @@ -161,6 +182,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -182,7 +208,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicyAssignment_List() { @@ -233,8 +259,33 @@ public GetAzRoleManagementPolicyAssignment_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -287,7 +338,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -305,7 +356,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -343,12 +394,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -365,15 +416,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope }) + 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 } }); @@ -383,12 +434,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -400,15 +451,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs index 8097c0a5b90c..1fe1b3b6160e 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role management policy for a resource scope @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicy_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicy_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzRoleManagementPolicy_Get : global::System.Management.A /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzRoleManagementPolicy_Get : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -94,7 +115,7 @@ public partial class GetAzRoleManagementPolicy_Get : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -131,24 +152,24 @@ public partial class GetAzRoleManagementPolicy_Get : global::System.Management.A /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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); + 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) @@ -171,6 +192,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -192,7 +218,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicy_Get() { @@ -243,8 +269,33 @@ public GetAzRoleManagementPolicy_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -297,7 +348,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -315,7 +366,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,12 +404,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -375,15 +426,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -393,12 +444,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,8 +461,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs index 4af4b0e31d00..5d5f4d1b91da 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role management policy for a resource scope @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicy_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzRoleManagementPolicy_GetViaIdentity : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzRoleManagementPolicy_GetViaIdentity : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -87,7 +108,7 @@ public partial class GetAzRoleManagementPolicy_GetViaIdentity : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -110,24 +131,24 @@ public partial class GetAzRoleManagementPolicy_GetViaIdentity : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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); + 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) @@ -150,6 +171,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +197,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicy_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzRoleManagementPolicy_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +327,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,7 +361,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -348,12 +399,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -370,7 +421,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -388,12 +439,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -405,8 +456,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs index 0d2414a09fb0..e1b73efff65b 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role management policies for a resource scope. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicy_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role management policies for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicy_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzRoleManagementPolicy_List : global::System.Management. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzRoleManagementPolicy_List : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -85,7 +106,7 @@ public partial class GetAzRoleManagementPolicy_List : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -122,24 +143,24 @@ public partial class GetAzRoleManagementPolicy_List : global::System.Management. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult /// 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); + 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) @@ -162,6 +183,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -183,7 +209,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicy_List() { @@ -234,8 +260,33 @@ public GetAzRoleManagementPolicy_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -288,7 +339,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -306,7 +357,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,12 +395,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -366,15 +417,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope }) + 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 } }); @@ -384,12 +435,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -401,15 +452,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs index e4ebc31ad4f3..7e74b4554b23 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Creates a role assignment schedule request. + /// create a role assignment schedule request. /// /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleAssignmentScheduleRequest_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Creates a role assignment schedule request.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,14 +37,29 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// Role Assignment schedule request - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -110,9 +128,12 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: ReadOnly = false, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type))] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type ExpirationType { get => _parametersBody.ExpirationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); set => _parametersBody.ExpirationType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// 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")] @@ -177,7 +198,7 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The principal ID. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] @@ -216,9 +237,9 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: ReadOnly = false, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType))] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get => _parametersBody.RequestType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType)""); set => _parametersBody.RequestType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } /// The role definition ID. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] @@ -312,24 +333,24 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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) @@ -352,6 +373,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -416,8 +442,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -427,7 +478,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzRoleAssignmentScheduleRequest_CreateExpanded() { @@ -481,7 +532,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -494,12 +545,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.RoleAssignmentScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline); + await this.Client.RoleAssignmentScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -535,12 +586,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -552,8 +603,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -561,12 +630,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -583,15 +652,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name, body=_parametersBody }) + 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 } }); diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..9e060c6f75ae --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath.cs @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role assignment schedule request. + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleAssignmentScheduleRequest_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role assignment schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role assignment to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role assignment to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role assignment to create. It can be any valid GUID.", + SerializedName = @"roleAssignmentScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleAssignmentScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleAssignmentScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleAssignmentScheduleRequestsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonString.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonString.cs new file mode 100644 index 000000000000..9e1c8c02bdfb --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonString.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role assignment schedule request. + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleAssignmentScheduleRequest_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role assignment schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleAssignmentScheduleRequest_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role assignment to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role assignment to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role assignment to create. It can be any valid GUID.", + SerializedName = @"roleAssignmentScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleAssignmentScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzRoleAssignmentScheduleRequest_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleAssignmentScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleAssignmentScheduleRequestsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs index 073aca1a8833..5edb6a0bb32a 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Creates a role eligibility schedule request. + /// create a role eligibility schedule request. /// /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleEligibilityScheduleRequest_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Creates a role eligibility schedule request.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,14 +37,29 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// Role Eligibility schedule request - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -110,9 +128,12 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global ReadOnly = false, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type))] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type ExpirationType { get => _parametersBody.ExpirationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); set => _parametersBody.ExpirationType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// 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")] @@ -166,7 +187,7 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The principal ID. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] @@ -205,9 +226,9 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global ReadOnly = false, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType))] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get => _parametersBody.RequestType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType)""); set => _parametersBody.RequestType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } /// The role definition ID. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] @@ -301,24 +322,24 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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) @@ -341,6 +362,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -405,8 +431,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -416,7 +467,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzRoleEligibilityScheduleRequest_CreateExpanded() { @@ -470,7 +521,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -483,12 +534,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.RoleEligibilityScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline); + await this.Client.RoleEligibilityScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -524,12 +575,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -541,8 +592,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -550,12 +619,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -572,15 +641,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name, body=_parametersBody }) + 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 } }); diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..68151895415a --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath.cs @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role eligibility schedule request. + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleEligibilityScheduleRequest_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role eligibility schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role eligibility to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role eligibility to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role eligibility to create. It can be any valid GUID.", + SerializedName = @"roleEligibilityScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleEligibilityScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleEligibilityScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleEligibilityScheduleRequestsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonString.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonString.cs new file mode 100644 index 000000000000..4c24fd1a5200 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonString.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role eligibility schedule request. + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleEligibilityScheduleRequest_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role eligibility schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleEligibilityScheduleRequest_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role eligibility to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role eligibility to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role eligibility to create. It can be any valid GUID.", + SerializedName = @"roleEligibilityScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleEligibilityScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzRoleEligibilityScheduleRequest_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleEligibilityScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleEligibilityScheduleRequestsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs index bee7ab1754db..fbf504538863 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Create a role management policy assignment + /// create a role management policy assignment /// /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleManagementPolicyAssignment_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Create a role management policy assignment")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role management policy assignment")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,14 +37,29 @@ public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// Role management policy - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -96,7 +117,7 @@ public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The policy id role management policy assignment. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The policy id role management policy assignment.")] @@ -155,24 +176,24 @@ public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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) @@ -195,6 +216,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -259,8 +285,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -270,7 +321,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzRoleManagementPolicyAssignment_CreateExpanded() { @@ -324,7 +375,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,12 +388,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.RoleManagementPolicyAssignmentsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline); + await this.Client.RoleManagementPolicyAssignmentsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -378,12 +429,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -395,8 +446,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -404,12 +473,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -426,15 +495,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name, body=_parametersBody }) + 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 } }); diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..1b17d70163a8 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath.cs @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role management policy assignment + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleManagementPolicyAssignment_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role management policy assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of format {guid_guid} the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of format {guid_guid} the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of format {guid_guid} the role management policy assignment to upsert.", + SerializedName = @"roleManagementPolicyAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyAssignmentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy assignment to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPolicyAssignmentsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleManagementPolicyAssignmentsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonString.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonString.cs new file mode 100644 index 000000000000..9229f2a2eb8c --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonString.cs @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role management policy assignment + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleManagementPolicyAssignment_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role management policy assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleManagementPolicyAssignment_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of format {guid_guid} the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of format {guid_guid} the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of format {guid_guid} the role management policy assignment to upsert.", + SerializedName = @"roleManagementPolicyAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyAssignmentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy assignment to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzRoleManagementPolicyAssignment_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPolicyAssignmentsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleManagementPolicyAssignmentsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs index 2d9eb8741426..4152ad5c0be5 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Delete a role management policy assignment @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +121,7 @@ public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -137,12 +158,12 @@ public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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 @@ -185,6 +206,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -249,8 +275,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -337,7 +388,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzRoleManagementPolicyAssignment_Delete() { @@ -370,12 +421,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -392,15 +443,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -425,7 +476,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -449,7 +500,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs index f838f72a512a..1d0511762c48 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Delete a role management policy assignment @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -116,12 +137,12 @@ public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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 @@ -164,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -332,7 +383,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity() { @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,7 +438,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -420,7 +471,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -444,7 +495,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs index 4faac11068c0..b57cf258d1b7 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Delete a role management policy @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Manage /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +121,7 @@ public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -137,12 +158,12 @@ public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Manage /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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 @@ -185,6 +206,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -249,8 +275,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -337,7 +388,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzRoleManagementPolicy_Delete() { @@ -370,12 +421,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -392,15 +443,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -425,7 +476,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -449,7 +500,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs index 59fed88e148f..4e3b2b4ba2e6 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Delete a role management policy @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::Sy /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -116,12 +137,12 @@ public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::Sy /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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 @@ -164,6 +185,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -332,7 +383,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzRoleManagementPolicy_DeleteViaIdentity() { @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,7 +438,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -420,7 +471,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -444,7 +495,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs index 6e642ad1b380..2ae2fa3b8490 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Cancels a pending role assignment schedule request. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +121,7 @@ public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -137,12 +158,12 @@ public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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 @@ -175,6 +196,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -239,8 +265,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzRoleAssignmentScheduleRequest_Cancel() { @@ -360,12 +411,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -382,15 +433,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -415,7 +466,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs index 2507f19586db..df31430df8fc 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Cancels a pending role assignment schedule request. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : glo /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : glo [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -116,12 +137,12 @@ public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : glo /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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 @@ -154,6 +175,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -218,8 +244,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -322,7 +373,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzRoleAssignmentScheduleRequest_CancelViaIdentity() { @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +428,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -410,7 +461,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs index 7774cb13db55..8e35e8255d07 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Cancels a pending role eligibility schedule request. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::Syste /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -100,7 +121,7 @@ public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -137,12 +158,12 @@ public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::Syste /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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 @@ -175,6 +196,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -239,8 +265,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzRoleEligibilityScheduleRequest_Cancel() { @@ -360,12 +411,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -382,15 +433,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + 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 } }); @@ -415,7 +466,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs index 6a1e2f5173b0..a1db963b2e78 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Cancels a pending role eligibility schedule request. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : gl /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -93,7 +114,7 @@ public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -116,12 +137,12 @@ public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : gl /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + 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 @@ -154,6 +175,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -218,8 +244,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + 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 } }); @@ -322,7 +373,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzRoleEligibilityScheduleRequest_CancelViaIdentity() { @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +428,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -410,7 +461,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded.cs new file mode 100644 index 000000000000..2866ab50eb19 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded.cs @@ -0,0 +1,737 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role assignment schedule request. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleAssignmentScheduleRequest_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role assignment schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// Role Assignment schedule request + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + /// StringEqualsIgnoreCase 'foo_storage_container' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + SerializedName = @"condition", + PossibleTypes = new [] { typeof(string) })] + public string Condition { get => _parametersBody.Condition ?? null; set => _parametersBody.Condition = value; } + + /// Version of the condition. Currently accepted value is '2.0' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Version of the condition. Currently accepted value is '2.0'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the condition. Currently accepted value is '2.0'", + SerializedName = @"conditionVersion", + PossibleTypes = new [] { typeof(string) })] + public string ConditionVersion { get => _parametersBody.ConditionVersion ?? null; set => _parametersBody.ConditionVersion = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Duration of the role assignment schedule in TimeSpan. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Duration of the role assignment schedule in TimeSpan.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration of the role assignment schedule in TimeSpan.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(string) })] + public string ExpirationDuration { get => _parametersBody.ExpirationDuration ?? null; set => _parametersBody.ExpirationDuration = value; } + + /// End DateTime of the role assignment schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End DateTime of the role assignment schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End DateTime of the role assignment schedule.", + SerializedName = @"endDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationEndDateTime { get => _parametersBody.ExpirationEndDateTime ?? default(global::System.DateTime); set => _parametersBody.ExpirationEndDateTime = value; } + + /// Type of the role assignment schedule expiration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the role assignment schedule expiration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the role assignment schedule expiration", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Justification for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Justification for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Justification for the role assignment", + SerializedName = @"justification", + PossibleTypes = new [] { typeof(string) })] + public string Justification { get => _parametersBody.Justification ?? null; set => _parametersBody.Justification = value; } + + /// The linked role eligibility schedule id - to activate an eligibility. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The linked role eligibility schedule id - to activate an eligibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The linked role eligibility schedule id - to activate an eligibility.", + SerializedName = @"linkedRoleEligibilityScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string LinkedRoleEligibilityScheduleId { get => _parametersBody.LinkedRoleEligibilityScheduleId ?? null; set => _parametersBody.LinkedRoleEligibilityScheduleId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role assignment to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role assignment to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role assignment to create. It can be any valid GUID.", + SerializedName = @"roleAssignmentScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleAssignmentScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The principal ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string PrincipalId { get => _parametersBody.PrincipalId ?? null; set => _parametersBody.PrincipalId = 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } + + /// The role definition ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition ID.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Start DateTime of the role assignment schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start DateTime of the role assignment schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start DateTime of the role assignment schedule.", + SerializedName = @"startDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ScheduleInfoStartDateTime { get => _parametersBody.ScheduleInfoStartDateTime ?? default(global::System.DateTime); set => _parametersBody.ScheduleInfoStartDateTime = value; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// The resultant role assignment schedule id or the role assignment schedule id being updated + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resultant role assignment schedule id or the role assignment schedule id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resultant role assignment schedule id or the role assignment schedule id being updated", + SerializedName = @"targetRoleAssignmentScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleAssignmentScheduleId { get => _parametersBody.TargetRoleAssignmentScheduleId ?? null; set => _parametersBody.TargetRoleAssignmentScheduleId = value; } + + /// The role assignment schedule instance id being updated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role assignment schedule instance id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role assignment schedule instance id being updated", + SerializedName = @"targetRoleAssignmentScheduleInstanceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleAssignmentScheduleInstanceId { get => _parametersBody.TargetRoleAssignmentScheduleInstanceId ?? null; set => _parametersBody.TargetRoleAssignmentScheduleInstanceId = value; } + + /// Ticket number for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket number for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket number for the role assignment", + SerializedName = @"ticketNumber", + PossibleTypes = new [] { typeof(string) })] + public string TicketNumber { get => _parametersBody.TicketInfoTicketNumber ?? null; set => _parametersBody.TicketInfoTicketNumber = value; } + + /// Ticket system name for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket system name for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket system name for the role assignment", + SerializedName = @"ticketSystem", + PossibleTypes = new [] { typeof(string) })] + public string TicketSystem { get => _parametersBody.TicketInfoTicketSystem ?? null; set => _parametersBody.TicketInfoTicketSystem = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleAssignmentScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _parametersBody = await this.Client.RoleAssignmentScheduleRequestsGetWithResult(Scope, Name, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleAssignmentScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RequestType"))) + { + this.RequestType = (string)(this.MyInvocation?.BoundParameters["RequestType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrincipalId"))) + { + this.PrincipalId = (string)(this.MyInvocation?.BoundParameters["PrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleAssignmentScheduleId"))) + { + this.TargetRoleAssignmentScheduleId = (string)(this.MyInvocation?.BoundParameters["TargetRoleAssignmentScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleAssignmentScheduleInstanceId"))) + { + this.TargetRoleAssignmentScheduleInstanceId = (string)(this.MyInvocation?.BoundParameters["TargetRoleAssignmentScheduleInstanceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LinkedRoleEligibilityScheduleId"))) + { + this.LinkedRoleEligibilityScheduleId = (string)(this.MyInvocation?.BoundParameters["LinkedRoleEligibilityScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Justification"))) + { + this.Justification = (string)(this.MyInvocation?.BoundParameters["Justification"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Condition"))) + { + this.Condition = (string)(this.MyInvocation?.BoundParameters["Condition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ConditionVersion"))) + { + this.ConditionVersion = (string)(this.MyInvocation?.BoundParameters["ConditionVersion"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScheduleInfoStartDateTime"))) + { + this.ScheduleInfoStartDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ScheduleInfoStartDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationType"))) + { + this.ExpirationType = (string)(this.MyInvocation?.BoundParameters["ExpirationType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketNumber"))) + { + this.TicketNumber = (string)(this.MyInvocation?.BoundParameters["TicketNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketSystem"))) + { + this.TicketSystem = (string)(this.MyInvocation?.BoundParameters["TicketSystem"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationEndDateTime"))) + { + this.ExpirationEndDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ExpirationEndDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationDuration"))) + { + this.ExpirationDuration = (string)(this.MyInvocation?.BoundParameters["ExpirationDuration"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..7198f9485595 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded.cs @@ -0,0 +1,730 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role assignment schedule request. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role assignment schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// Role Assignment schedule request + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + /// StringEqualsIgnoreCase 'foo_storage_container' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + SerializedName = @"condition", + PossibleTypes = new [] { typeof(string) })] + public string Condition { get => _parametersBody.Condition ?? null; set => _parametersBody.Condition = value; } + + /// Version of the condition. Currently accepted value is '2.0' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Version of the condition. Currently accepted value is '2.0'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the condition. Currently accepted value is '2.0'", + SerializedName = @"conditionVersion", + PossibleTypes = new [] { typeof(string) })] + public string ConditionVersion { get => _parametersBody.ConditionVersion ?? null; set => _parametersBody.ConditionVersion = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Duration of the role assignment schedule in TimeSpan. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Duration of the role assignment schedule in TimeSpan.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration of the role assignment schedule in TimeSpan.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(string) })] + public string ExpirationDuration { get => _parametersBody.ExpirationDuration ?? null; set => _parametersBody.ExpirationDuration = value; } + + /// End DateTime of the role assignment schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End DateTime of the role assignment schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End DateTime of the role assignment schedule.", + SerializedName = @"endDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationEndDateTime { get => _parametersBody.ExpirationEndDateTime ?? default(global::System.DateTime); set => _parametersBody.ExpirationEndDateTime = value; } + + /// Type of the role assignment schedule expiration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the role assignment schedule expiration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the role assignment schedule expiration", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity 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; } } + + /// Justification for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Justification for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Justification for the role assignment", + SerializedName = @"justification", + PossibleTypes = new [] { typeof(string) })] + public string Justification { get => _parametersBody.Justification ?? null; set => _parametersBody.Justification = value; } + + /// The linked role eligibility schedule id - to activate an eligibility. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The linked role eligibility schedule id - to activate an eligibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The linked role eligibility schedule id - to activate an eligibility.", + SerializedName = @"linkedRoleEligibilityScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string LinkedRoleEligibilityScheduleId { get => _parametersBody.LinkedRoleEligibilityScheduleId ?? null; set => _parametersBody.LinkedRoleEligibilityScheduleId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The principal ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string PrincipalId { get => _parametersBody.PrincipalId ?? null; set => _parametersBody.PrincipalId = 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } + + /// The role definition ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition ID.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Start DateTime of the role assignment schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start DateTime of the role assignment schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start DateTime of the role assignment schedule.", + SerializedName = @"startDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ScheduleInfoStartDateTime { get => _parametersBody.ScheduleInfoStartDateTime ?? default(global::System.DateTime); set => _parametersBody.ScheduleInfoStartDateTime = value; } + + /// + /// The resultant role assignment schedule id or the role assignment schedule id being updated + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resultant role assignment schedule id or the role assignment schedule id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resultant role assignment schedule id or the role assignment schedule id being updated", + SerializedName = @"targetRoleAssignmentScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleAssignmentScheduleId { get => _parametersBody.TargetRoleAssignmentScheduleId ?? null; set => _parametersBody.TargetRoleAssignmentScheduleId = value; } + + /// The role assignment schedule instance id being updated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role assignment schedule instance id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role assignment schedule instance id being updated", + SerializedName = @"targetRoleAssignmentScheduleInstanceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleAssignmentScheduleInstanceId { get => _parametersBody.TargetRoleAssignmentScheduleInstanceId ?? null; set => _parametersBody.TargetRoleAssignmentScheduleInstanceId = value; } + + /// Ticket number for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket number for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket number for the role assignment", + SerializedName = @"ticketNumber", + PossibleTypes = new [] { typeof(string) })] + public string TicketNumber { get => _parametersBody.TicketInfoTicketNumber ?? null; set => _parametersBody.TicketInfoTicketNumber = value; } + + /// Ticket system name for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket system name for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket system name for the role assignment", + SerializedName = @"ticketSystem", + PossibleTypes = new [] { typeof(string) })] + public string TicketSystem { get => _parametersBody.TicketInfoTicketSystem ?? null; set => _parametersBody.TicketInfoTicketSystem = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleAssignmentScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _parametersBody = await this.Client.RoleAssignmentScheduleRequestsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleAssignmentScheduleRequestsCreateViaIdentity(InputObject.Id, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RoleAssignmentScheduleRequestName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleAssignmentScheduleRequestName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _parametersBody = await this.Client.RoleAssignmentScheduleRequestsGetWithResult(InputObject.Scope ?? null, InputObject.RoleAssignmentScheduleRequestName ?? null, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleAssignmentScheduleRequestsCreate(InputObject.Scope ?? null, InputObject.RoleAssignmentScheduleRequestName ?? null, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RequestType"))) + { + this.RequestType = (string)(this.MyInvocation?.BoundParameters["RequestType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrincipalId"))) + { + this.PrincipalId = (string)(this.MyInvocation?.BoundParameters["PrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleAssignmentScheduleId"))) + { + this.TargetRoleAssignmentScheduleId = (string)(this.MyInvocation?.BoundParameters["TargetRoleAssignmentScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleAssignmentScheduleInstanceId"))) + { + this.TargetRoleAssignmentScheduleInstanceId = (string)(this.MyInvocation?.BoundParameters["TargetRoleAssignmentScheduleInstanceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LinkedRoleEligibilityScheduleId"))) + { + this.LinkedRoleEligibilityScheduleId = (string)(this.MyInvocation?.BoundParameters["LinkedRoleEligibilityScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Justification"))) + { + this.Justification = (string)(this.MyInvocation?.BoundParameters["Justification"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Condition"))) + { + this.Condition = (string)(this.MyInvocation?.BoundParameters["Condition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ConditionVersion"))) + { + this.ConditionVersion = (string)(this.MyInvocation?.BoundParameters["ConditionVersion"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScheduleInfoStartDateTime"))) + { + this.ScheduleInfoStartDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ScheduleInfoStartDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationType"))) + { + this.ExpirationType = (string)(this.MyInvocation?.BoundParameters["ExpirationType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketNumber"))) + { + this.TicketNumber = (string)(this.MyInvocation?.BoundParameters["TicketNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketSystem"))) + { + this.TicketSystem = (string)(this.MyInvocation?.BoundParameters["TicketSystem"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationEndDateTime"))) + { + this.ExpirationEndDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ExpirationEndDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationDuration"))) + { + this.ExpirationDuration = (string)(this.MyInvocation?.BoundParameters["ExpirationDuration"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded.cs new file mode 100644 index 000000000000..84009d33562a --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded.cs @@ -0,0 +1,722 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role eligibility schedule request. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleEligibilityScheduleRequest_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role eligibility schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// Role Eligibility schedule request + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + /// StringEqualsIgnoreCase 'foo_storage_container' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + SerializedName = @"condition", + PossibleTypes = new [] { typeof(string) })] + public string Condition { get => _parametersBody.Condition ?? null; set => _parametersBody.Condition = value; } + + /// Version of the condition. Currently accepted value is '2.0' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Version of the condition. Currently accepted value is '2.0'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the condition. Currently accepted value is '2.0'", + SerializedName = @"conditionVersion", + PossibleTypes = new [] { typeof(string) })] + public string ConditionVersion { get => _parametersBody.ConditionVersion ?? null; set => _parametersBody.ConditionVersion = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Duration of the role eligibility schedule in TimeSpan. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Duration of the role eligibility schedule in TimeSpan.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration of the role eligibility schedule in TimeSpan.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(string) })] + public string ExpirationDuration { get => _parametersBody.ExpirationDuration ?? null; set => _parametersBody.ExpirationDuration = value; } + + /// End DateTime of the role eligibility schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End DateTime of the role eligibility schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End DateTime of the role eligibility schedule.", + SerializedName = @"endDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationEndDateTime { get => _parametersBody.ExpirationEndDateTime ?? default(global::System.DateTime); set => _parametersBody.ExpirationEndDateTime = value; } + + /// Type of the role eligibility schedule expiration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the role eligibility schedule expiration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the role eligibility schedule expiration", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Justification for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Justification for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Justification for the role eligibility", + SerializedName = @"justification", + PossibleTypes = new [] { typeof(string) })] + public string Justification { get => _parametersBody.Justification ?? null; set => _parametersBody.Justification = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role eligibility to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role eligibility to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role eligibility to create. It can be any valid GUID.", + SerializedName = @"roleEligibilityScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleEligibilityScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The principal ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string PrincipalId { get => _parametersBody.PrincipalId ?? null; set => _parametersBody.PrincipalId = 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } + + /// The role definition ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition ID.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Start DateTime of the role eligibility schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start DateTime of the role eligibility schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start DateTime of the role eligibility schedule.", + SerializedName = @"startDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ScheduleInfoStartDateTime { get => _parametersBody.ScheduleInfoStartDateTime ?? default(global::System.DateTime); set => _parametersBody.ScheduleInfoStartDateTime = value; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// The resultant role eligibility schedule id or the role eligibility schedule id being updated + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resultant role eligibility schedule id or the role eligibility schedule id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resultant role eligibility schedule id or the role eligibility schedule id being updated", + SerializedName = @"targetRoleEligibilityScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleEligibilityScheduleId { get => _parametersBody.TargetRoleEligibilityScheduleId ?? null; set => _parametersBody.TargetRoleEligibilityScheduleId = value; } + + /// The role eligibility schedule instance id being updated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role eligibility schedule instance id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role eligibility schedule instance id being updated", + SerializedName = @"targetRoleEligibilityScheduleInstanceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleEligibilityScheduleInstanceId { get => _parametersBody.TargetRoleEligibilityScheduleInstanceId ?? null; set => _parametersBody.TargetRoleEligibilityScheduleInstanceId = value; } + + /// Ticket number for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket number for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket number for the role eligibility", + SerializedName = @"ticketNumber", + PossibleTypes = new [] { typeof(string) })] + public string TicketNumber { get => _parametersBody.TicketInfoTicketNumber ?? null; set => _parametersBody.TicketInfoTicketNumber = value; } + + /// Ticket system name for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket system name for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket system name for the role eligibility", + SerializedName = @"ticketSystem", + PossibleTypes = new [] { typeof(string) })] + public string TicketSystem { get => _parametersBody.TicketInfoTicketSystem ?? null; set => _parametersBody.TicketInfoTicketSystem = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleEligibilityScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _parametersBody = await this.Client.RoleEligibilityScheduleRequestsGetWithResult(Scope, Name, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleEligibilityScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RequestType"))) + { + this.RequestType = (string)(this.MyInvocation?.BoundParameters["RequestType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrincipalId"))) + { + this.PrincipalId = (string)(this.MyInvocation?.BoundParameters["PrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleEligibilityScheduleId"))) + { + this.TargetRoleEligibilityScheduleId = (string)(this.MyInvocation?.BoundParameters["TargetRoleEligibilityScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleEligibilityScheduleInstanceId"))) + { + this.TargetRoleEligibilityScheduleInstanceId = (string)(this.MyInvocation?.BoundParameters["TargetRoleEligibilityScheduleInstanceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Justification"))) + { + this.Justification = (string)(this.MyInvocation?.BoundParameters["Justification"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Condition"))) + { + this.Condition = (string)(this.MyInvocation?.BoundParameters["Condition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ConditionVersion"))) + { + this.ConditionVersion = (string)(this.MyInvocation?.BoundParameters["ConditionVersion"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScheduleInfoStartDateTime"))) + { + this.ScheduleInfoStartDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ScheduleInfoStartDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationType"))) + { + this.ExpirationType = (string)(this.MyInvocation?.BoundParameters["ExpirationType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketNumber"))) + { + this.TicketNumber = (string)(this.MyInvocation?.BoundParameters["TicketNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketSystem"))) + { + this.TicketSystem = (string)(this.MyInvocation?.BoundParameters["TicketSystem"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationEndDateTime"))) + { + this.ExpirationEndDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ExpirationEndDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationDuration"))) + { + this.ExpirationDuration = (string)(this.MyInvocation?.BoundParameters["ExpirationDuration"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..365685adfef4 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded.cs @@ -0,0 +1,715 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role eligibility schedule request. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role eligibility schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// Role Eligibility schedule request + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + /// StringEqualsIgnoreCase 'foo_storage_container' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + SerializedName = @"condition", + PossibleTypes = new [] { typeof(string) })] + public string Condition { get => _parametersBody.Condition ?? null; set => _parametersBody.Condition = value; } + + /// Version of the condition. Currently accepted value is '2.0' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Version of the condition. Currently accepted value is '2.0'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the condition. Currently accepted value is '2.0'", + SerializedName = @"conditionVersion", + PossibleTypes = new [] { typeof(string) })] + public string ConditionVersion { get => _parametersBody.ConditionVersion ?? null; set => _parametersBody.ConditionVersion = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Duration of the role eligibility schedule in TimeSpan. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Duration of the role eligibility schedule in TimeSpan.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration of the role eligibility schedule in TimeSpan.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(string) })] + public string ExpirationDuration { get => _parametersBody.ExpirationDuration ?? null; set => _parametersBody.ExpirationDuration = value; } + + /// End DateTime of the role eligibility schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End DateTime of the role eligibility schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End DateTime of the role eligibility schedule.", + SerializedName = @"endDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationEndDateTime { get => _parametersBody.ExpirationEndDateTime ?? default(global::System.DateTime); set => _parametersBody.ExpirationEndDateTime = value; } + + /// Type of the role eligibility schedule expiration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the role eligibility schedule expiration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the role eligibility schedule expiration", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity 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; } } + + /// Justification for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Justification for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Justification for the role eligibility", + SerializedName = @"justification", + PossibleTypes = new [] { typeof(string) })] + public string Justification { get => _parametersBody.Justification ?? null; set => _parametersBody.Justification = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The principal ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string PrincipalId { get => _parametersBody.PrincipalId ?? null; set => _parametersBody.PrincipalId = 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } + + /// The role definition ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition ID.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Start DateTime of the role eligibility schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start DateTime of the role eligibility schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start DateTime of the role eligibility schedule.", + SerializedName = @"startDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ScheduleInfoStartDateTime { get => _parametersBody.ScheduleInfoStartDateTime ?? default(global::System.DateTime); set => _parametersBody.ScheduleInfoStartDateTime = value; } + + /// + /// The resultant role eligibility schedule id or the role eligibility schedule id being updated + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resultant role eligibility schedule id or the role eligibility schedule id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resultant role eligibility schedule id or the role eligibility schedule id being updated", + SerializedName = @"targetRoleEligibilityScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleEligibilityScheduleId { get => _parametersBody.TargetRoleEligibilityScheduleId ?? null; set => _parametersBody.TargetRoleEligibilityScheduleId = value; } + + /// The role eligibility schedule instance id being updated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role eligibility schedule instance id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role eligibility schedule instance id being updated", + SerializedName = @"targetRoleEligibilityScheduleInstanceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleEligibilityScheduleInstanceId { get => _parametersBody.TargetRoleEligibilityScheduleInstanceId ?? null; set => _parametersBody.TargetRoleEligibilityScheduleInstanceId = value; } + + /// Ticket number for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket number for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket number for the role eligibility", + SerializedName = @"ticketNumber", + PossibleTypes = new [] { typeof(string) })] + public string TicketNumber { get => _parametersBody.TicketInfoTicketNumber ?? null; set => _parametersBody.TicketInfoTicketNumber = value; } + + /// Ticket system name for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket system name for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket system name for the role eligibility", + SerializedName = @"ticketSystem", + PossibleTypes = new [] { typeof(string) })] + public string TicketSystem { get => _parametersBody.TicketInfoTicketSystem ?? null; set => _parametersBody.TicketInfoTicketSystem = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleEligibilityScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _parametersBody = await this.Client.RoleEligibilityScheduleRequestsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleEligibilityScheduleRequestsCreateViaIdentity(InputObject.Id, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RoleEligibilityScheduleRequestName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleEligibilityScheduleRequestName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _parametersBody = await this.Client.RoleEligibilityScheduleRequestsGetWithResult(InputObject.Scope ?? null, InputObject.RoleEligibilityScheduleRequestName ?? null, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleEligibilityScheduleRequestsCreate(InputObject.Scope ?? null, InputObject.RoleEligibilityScheduleRequestName ?? null, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RequestType"))) + { + this.RequestType = (string)(this.MyInvocation?.BoundParameters["RequestType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrincipalId"))) + { + this.PrincipalId = (string)(this.MyInvocation?.BoundParameters["PrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleEligibilityScheduleId"))) + { + this.TargetRoleEligibilityScheduleId = (string)(this.MyInvocation?.BoundParameters["TargetRoleEligibilityScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleEligibilityScheduleInstanceId"))) + { + this.TargetRoleEligibilityScheduleInstanceId = (string)(this.MyInvocation?.BoundParameters["TargetRoleEligibilityScheduleInstanceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Justification"))) + { + this.Justification = (string)(this.MyInvocation?.BoundParameters["Justification"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Condition"))) + { + this.Condition = (string)(this.MyInvocation?.BoundParameters["Condition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ConditionVersion"))) + { + this.ConditionVersion = (string)(this.MyInvocation?.BoundParameters["ConditionVersion"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScheduleInfoStartDateTime"))) + { + this.ScheduleInfoStartDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ScheduleInfoStartDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationType"))) + { + this.ExpirationType = (string)(this.MyInvocation?.BoundParameters["ExpirationType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketNumber"))) + { + this.TicketNumber = (string)(this.MyInvocation?.BoundParameters["TicketNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketSystem"))) + { + this.TicketSystem = (string)(this.MyInvocation?.BoundParameters["TicketSystem"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationEndDateTime"))) + { + this.ExpirationEndDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ExpirationEndDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationDuration"))) + { + this.ExpirationDuration = (string)(this.MyInvocation?.BoundParameters["ExpirationDuration"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateExpanded.cs new file mode 100644 index 000000000000..a05ec86fbdc5 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateExpanded.cs @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role management policy assignment + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicyAssignment_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleManagementPolicyAssignment_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// Role management policy + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of format {guid_guid} the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of format {guid_guid} the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of format {guid_guid} the role management policy assignment to upsert.", + SerializedName = @"roleManagementPolicyAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyAssignmentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The policy id role management policy assignment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The policy id role management policy assignment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The policy id role management policy assignment.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + public string PolicyId { get => _parametersBody.PolicyId ?? null; set => _parametersBody.PolicyId = 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The role definition of management policy assignment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition of management policy assignment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition of management policy assignment.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy assignment to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPolicyAssignmentsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _parametersBody = await this.Client.RoleManagementPolicyAssignmentsGetWithResult(Scope, Name, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleManagementPolicyAssignmentsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleManagementPolicyAssignment_UpdateExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PolicyId"))) + { + this.PolicyId = (string)(this.MyInvocation?.BoundParameters["PolicyId"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..513f62ffcca3 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role management policy assignment + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// Role management policy + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity 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.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The policy id role management policy assignment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The policy id role management policy assignment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The policy id role management policy assignment.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + public string PolicyId { get => _parametersBody.PolicyId ?? null; set => _parametersBody.PolicyId = 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The role definition of management policy assignment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition of management policy assignment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition of management policy assignment.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPolicyAssignmentsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _parametersBody = await this.Client.RoleManagementPolicyAssignmentsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleManagementPolicyAssignmentsCreateViaIdentity(InputObject.Id, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RoleManagementPolicyAssignmentName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleManagementPolicyAssignmentName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _parametersBody = await this.Client.RoleManagementPolicyAssignmentsGetWithResult(InputObject.Scope ?? null, InputObject.RoleManagementPolicyAssignmentName ?? null, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleManagementPolicyAssignmentsCreate(InputObject.Scope ?? null, InputObject.RoleManagementPolicyAssignmentName ?? null, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PolicyId"))) + { + this.PolicyId = (string)(this.MyInvocation?.BoundParameters["PolicyId"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs index fb44d6f00cf1..14a1431f4f3c 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Update a role management policy + /// update a role management policy /// /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicy_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Update a role management policy")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +38,29 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// Role management policy - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -78,6 +96,9 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _parametersBody.DisplayName ?? null; set => _parametersBody.DisplayName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -130,7 +151,7 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -157,9 +178,9 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste ReadOnly = false, Description = @"The rule applied to the policy.", SerializedName = @"rules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ParameterBreakingChange("Rule", "15.0.0", "9.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get => _parametersBody.Rule ?? null /* arrayOf */; set => _parametersBody.Rule = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule[] Rule { get => _parametersBody.Rule?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Rule = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _scope; @@ -180,24 +201,24 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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); + 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) @@ -220,6 +241,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -284,8 +310,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -341,7 +392,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -354,12 +405,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.RoleManagementPoliciesUpdate(Scope, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.RoleManagementPoliciesUpdate(Scope, Name, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -379,7 +430,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzRoleManagementPolicy_UpdateExpanded() { @@ -405,12 +456,12 @@ public UpdateAzRoleManagementPolicy_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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -427,15 +478,15 @@ public UpdateAzRoleManagementPolicy_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name, body=_parametersBody }) + 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 } }); @@ -445,12 +496,12 @@ public UpdateAzRoleManagementPolicy_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -462,8 +513,26 @@ public UpdateAzRoleManagementPolicy_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs index 4400bb2da50c..bf5ae2d3c3bd 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Update a role management policy + /// update a role management policy /// /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicy_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Update a role management policy")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +38,29 @@ public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : gl /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// Role management policy - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -78,6 +96,9 @@ public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : gl PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _parametersBody.DisplayName ?? null; set => _parametersBody.DisplayName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// 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] @@ -123,7 +144,7 @@ public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -150,33 +171,33 @@ public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : gl ReadOnly = false, Description = @"The rule applied to the policy.", SerializedName = @"rules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ParameterBreakingChange("Rule", "15.0.0", "9.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get => _parametersBody.Rule ?? null /* arrayOf */; set => _parametersBody.Rule = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule[] Rule { get => _parametersBody.Rule?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Rule = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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); + 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) @@ -199,6 +220,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -263,8 +289,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -320,7 +371,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +386,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.RoleManagementPoliciesUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.RoleManagementPoliciesUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); } else { @@ -348,13 +399,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleManagementPolicyName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.RoleManagementPoliciesUpdate(InputObject.Scope ?? null, InputObject.RoleManagementPolicyName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.RoleManagementPoliciesUpdate(InputObject.Scope ?? null, InputObject.RoleManagementPolicyName ?? null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + 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 } }); @@ -374,7 +425,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded() { @@ -400,12 +451,12 @@ public UpdateAzRoleManagementPolicy_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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -422,15 +473,15 @@ public UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { body=_parametersBody }) + 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 } }); @@ -440,12 +491,12 @@ public UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -457,8 +508,26 @@ public UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..0dfd7124bdb6 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath.cs @@ -0,0 +1,506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role management policy + /// + /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicy_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name (guid) of the role management policy to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name (guid) of the role management policy to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name (guid) of the role management policy to upsert.", + SerializedName = @"roleManagementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// 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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPoliciesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleManagementPoliciesUpdateViaJsonString(Scope, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + /// 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.Resources.Authorization.Models.IRoleManagementPolicy + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonString.cs similarity index 74% rename from generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs rename to generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonString.cs index 9231d862203d..d779f53cbbc9 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonString.cs @@ -6,19 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Get the child resources of a resource on which user has eligible access + /// update a role management policy /// - /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/eligibleChildResources" + /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibleChildResource_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the child resources of a resource on which user has eligible access")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicy_UpdateViaJsonString", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/eligibleChildResources", ApiVersion = "2020-10-01-preview")] - public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class UpdateAzRoleManagementPolicy_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +39,26 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys /// 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; + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// Link to retrieve next page. - private string _nextLink; + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,23 +72,8 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - /// Backing field for property. - private string _filter; - - /// - /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = - /// 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of - /// type = 'Subscription' or 'ResourceGroup' - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'", - SerializedName = @"$filter", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Query)] - public string Filter { get => this._filter; set => this._filter = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// 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")] @@ -88,17 +87,22 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity 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; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -107,10 +111,25 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + /// Backing field for property. + private string _name; + + /// The name (guid) of the role management policy to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name (guid) of the role management policy to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name (guid) of the role management policy to upsert.", + SerializedName = @"roleManagementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -128,29 +147,43 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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); + 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) @@ -173,6 +206,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -193,14 +231,6 @@ protected override void EndProcessing() } } - /// - /// Intializes a new instance of the cmdlet class. - /// - public GetAzRoleEligibleChildResource_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 @@ -245,8 +275,33 @@ public GetAzRoleEligibleChildResource_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -263,9 +318,12 @@ protected override void ProcessRecord() try { // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + if (ShouldProcess($"Call remote 'RoleManagementPoliciesUpdate' operation")) { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token); + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token); + } } } catch (global::System.AggregateException aggregateException) @@ -299,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,24 +370,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.EligibleChildResourcesGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.Scope) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.EligibleChildResourcesGet(InputObject.Scope ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); - } + await this.Client.RoleManagementPoliciesUpdateViaJsonString(Scope, Name, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -348,6 +394,14 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleManagementPolicy_UpdateViaJsonString() + { + + } + /// new protected void WriteObject(object sendToPipeline) { @@ -367,12 +421,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -389,15 +443,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -407,12 +461,12 @@ protected override void 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 Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -424,22 +478,24 @@ protected override void StopProcessing() 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) + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + var result = (await response); + if (null != result) { - _isFirst = false; - while (_nextLink != null) + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else { - if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + if (1 ==_responseSize) { - requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get ); - await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.EligibleChildResourcesGet_Call(requestMessage, onOk, onDefault, this, Pipeline); + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; } } } diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..453e951f6e6c --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization +{ + using System; + using System.Collections.Generic; + using System.Text; + + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] + public class ExternalDocsAttribute : Attribute + { + + public string Description { get; } + + public string Url { get; } + + public ExternalDocsAttribute(string url) + { + Url = url; + } + + public ExternalDocsAttribute(string url, string description) + { + Url = url; + Description = description; + } + } +} diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..a9819bbe1a6e --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 24d4f23cf8fb..3a353119ca3b 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -20,11 +20,13 @@ public class ExportFormatPs1xml : PSCmdlet public string FilePath { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @""; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index e3b1afe81a28..dac8b25410fe 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -24,7 +24,7 @@ public class ExportModelSurface : PSCmdlet public bool UseExpandedFormat { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index fc2ea9393295..a47bdcb7f46a 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -70,9 +70,8 @@ protected override void ProcessRecord() var variantGroups = profileGroups.SelectMany(pg => pg.Variants .GroupBy(v => new { v.CmdletName, v.IsInternal }) .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), - Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) .ToArray(); - var license = new StringBuilder(); license.Append(@" # ---------------------------------------------------------------------------------- @@ -114,6 +113,7 @@ protected override void ProcessRecord() sb.Append("param("); sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) { var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 3264ce9f6528..d6e382a38bde 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() } else { - var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList(); sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); } @@ -148,8 +148,10 @@ protected override void ProcessRecord() } else { - var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); - sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); + if (!String.IsNullOrEmpty(aliasesList)) { + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } } // CmdletsToExport diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index b16aadc27e13..99e0539e3456 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 45528ca3696a..f0dc18286296 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -94,7 +94,7 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index ec6828166bea..2050461f6889 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -36,14 +36,23 @@ internal class PsHelpInfo public object Role { get; } public string NonTerminatingErrors { get; } + public static string CapitalizeFirstLetter(string text) + { + if (string.IsNullOrEmpty(text)) + return text; + + return char.ToUpper(text[0]) + text.Substring(1); + } + public PsHelpInfo(PSObject helpObject = null) { helpObject = helpObject ?? new PSObject(); CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); ModuleName = helpObject.GetProperty("ModuleName"); - Synopsis = helpObject.GetProperty("Synopsis"); + Synopsis = CapitalizeFirstLetter(helpObject.GetProperty("Synopsis")); Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + Description = CapitalizeFirstLetter(Description); AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); Category = helpObject.GetProperty("Category"); HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 88448e9091da..4ee1a8a35ba8 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -31,7 +31,7 @@ internal class MarkdownHelpInfo public string[] Inputs { get; } public string[] Outputs { get; } public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } - public string[] RelatedLinks { get; } + public MarkdownRelatedLinkInfo[] RelatedLinks { get; } public bool SupportsShouldProcess { get; } public bool SupportsPaging { get; } @@ -67,7 +67,11 @@ public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; OnlineVersion = commentInfo.OnlineVersion; - RelatedLinks = commentInfo.RelatedLinks; + + var relatedLinkLists = new List(); + relatedLinkLists.AddRange(commentInfo.RelatedLinks?.Select(link => new MarkdownRelatedLinkInfo(link))); + relatedLinkLists.AddRange(variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Distinct()?.Select(link => new MarkdownRelatedLinkInfo(link.Url, link.Description))); + RelatedLinks = relatedLinkLists?.ToArray(); SupportsShouldProcess = variantGroup.SupportsShouldProcess; SupportsPaging = variantGroup.SupportsPaging; @@ -218,14 +222,45 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param } } + internal class MarkdownRelatedLinkInfo + { + public string Url { get; } + public string Description { get; } + + public MarkdownRelatedLinkInfo(string url) + { + Url = url; + } + + public MarkdownRelatedLinkInfo(string url, string description) + { + Url = url; + Description = description; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(Description)) + { + return Url; + } + else + { + return $@"[{Description}]({Url})"; + + } + + } + } + internal static class MarkdownTypesExtensions { 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 }}", $@"{{{{ 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 }}"), + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index dbb0492d8459..7f2cac3673cb 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 817ee915f71d..fb3a2a4a76fd 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"Az.Resources";} + public string RootModuleName { get => @"Az.Resources"; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -374,6 +392,7 @@ public CommentInfo(VariantGroup variantGroup) var helpInfo = variantGroup.HelpInfo; Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() ?? helpInfo.Description.EmptyIfNull(); + Description = PsHelpInfo.CapitalizeFirstLetter(Description); // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; Synopsis = synopsis.NullIfEmpty() ?? Description; @@ -391,6 +410,9 @@ public CommentInfo(VariantGroup variantGroup) 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(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +442,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +465,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +513,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +542,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs index d169c03237d1..46e91cf21015 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -22,6 +22,11 @@ public class DoNotExportAttribute : Attribute { } + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class ModelCmdletAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Class)] public class InternalExportAttribute : Attribute { @@ -55,6 +60,11 @@ public class HttpPathAttribute : Attribute public string ApiVersion { get; set; } } + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -109,6 +119,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 856787d73ad4..2d5f9616a1dc 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Pow { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsHelpers.cs index be42fa53654b..55ae86fdc1ab 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -67,7 +67,7 @@ public static IEnumerable GetScriptHelpInfo(params string[] modulePath public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) { - var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" )); return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) @@ -88,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/Context.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..7df957279168 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/runtime/Context.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParameters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Authorization Client { get; } + } +} diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/Events.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Events.cs index 53511eb8fcdb..ffb09099d75e 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/Events.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/Events.cs @@ -22,6 +22,6 @@ public static partial class Events public const string FollowingNextLink = nameof(FollowingNextLink); public const string DelayBeforePolling = nameof(DelayBeforePolling); public const string Polling = nameof(Polling); - + public const string Progress = nameof(Progress); } -} \ No newline at end of file +} diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/ISendAsync.cs b/generated/Resources/Authorization.Autorest/generated/runtime/ISendAsync.cs index c9a8cd7d7170..f51181658781 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/InfoAttribute.cs b/generated/Resources/Authorization.Autorest/generated/runtime/InfoAttribute.cs index d6e90efdf6be..8f54d4d26e97 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/InfoAttribute.cs @@ -11,6 +11,9 @@ public class InfoAttribute : Attribute { public bool Required { get; set; } = false; public bool ReadOnly { get; set; } = false; + public bool Read { get; set; } = true; + public bool Create { get; set; } = true; + public bool Update { get; set; } = true; public Type[] PossibleTypes { get; set; } = new Type[0]; public string Description { get; set; } = ""; public string SerializedName { get; set; } = ""; @@ -30,5 +33,6 @@ public class DefaultInfoAttribute : Attribute public string Script { get; set; } = ""; public string Name { get; set; } = ""; public string Description { get; set; } = ""; + public string SetCondition { get; set; } = ""; } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/InputHandler.cs b/generated/Resources/Authorization.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..049fbeec84ac --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/runtime/InputHandler.cs @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets +{ + public abstract class InputHandler + { + protected InputHandler NextHandler = null; + + public void SetNextHandler(InputHandler nextHandler) + { + this.NextHandler = nextHandler; + } + + public abstract void Process(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs b/generated/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs index 153975a55117..999114d25e51 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime public class GenericBreakingChangeAttribute : Attribute { private string _message; - //A dexcription of what the change is about, non mandatory + //A description of what the change is about, non mandatory public string ChangeDescription { get; set; } = null; + //Name of the module that is being deprecated + public string moduleName { get; set; } = String.IsNullOrEmpty(@"Az.Resources") ? @"Az.Authorization" : @"Az.Resources"; + //The version the change is effective from, non mandatory public string DeprecateByVersion { get; } public string DeprecateByAzVersion { get; } @@ -82,7 +85,7 @@ public void PrintCustomAttributeInfo(Action writeOutput) } writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); - writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.moduleName, this.DeprecateByVersion)); if (OldWay != null && NewWay != null) { @@ -191,11 +194,11 @@ public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this( this.IsEstimatedGaDateSet = true; } } - + public void PrintCustomAttributeInfo(Action writeOutput) { writeOutput(this._message); - + if (IsEstimatedGaDateSet) { writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index b326c0e17bb6..a5e5a21e9c3f 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx b/generated/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx @@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can -- The change is expected to take effect from version : '{0}' +- The change is expected to take effect in '{0}' from version : '{1}' ```powershell diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/SerializationMode.cs b/generated/Resources/Authorization.Autorest/generated/runtime/SerializationMode.cs index 81d1bc78b427..86e27bbc3f1d 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/SerializationMode.cs @@ -9,8 +9,10 @@ public enum SerializationMode { None = 0, IncludeHeaders = 1 << 0, - IncludeReadOnly = 1 << 1, - - IncludeAll = IncludeHeaders | IncludeReadOnly + IncludeRead = 1 << 1, + IncludeCreate = 1 << 2, + IncludeUpdate = 1 << 3, + IncludeAll = IncludeHeaders | IncludeRead | IncludeCreate | IncludeUpdate, + IncludeCreateOrUpdate = IncludeCreate | IncludeUpdate } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Resources/Authorization.Autorest/generated/runtime/TypeConverterExtensions.cs index b00810c9b058..af4102d84ea9 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/Resources/Authorization.Autorest/test-module.ps1 b/generated/Resources/Authorization.Autorest/test-module.ps1 index 2b747f6f7d2e..6bb3fe29276a 100644 --- a/generated/Resources/Authorization.Autorest/test-module.ps1 +++ b/generated/Resources/Authorization.Autorest/test-module.ps1 @@ -12,17 +12,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +param([switch]$NotIsolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) $ErrorActionPreference = 'Stop' -if(-not $Isolated) +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' if ($PSBoundParameters.ContainsKey("TestName")) { $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," } $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -34,7 +34,7 @@ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and $ProgressPreference = 'SilentlyContinue' $baseName = $PSScriptRoot.BaseName $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) -. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule . ("$PSScriptRoot\test\utils.ps1") if ($requireResourceModule) @@ -95,4 +95,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------'